> For the complete documentation index, see [llms.txt](https://docs.fabricplan.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.fabricplan.com/documentation/plan/planning-sheets/formula-syntax/time-intelligence-functions/filter.md).

# FILTER

The FILTER formula filters measure values across a period range and returns only those values that satisfy specified conditions. Combine the FILTER function with an aggregation function like SUM/AVG, etc.

## Syntax

```javascript
FILTER(measure, periodRange, condition1, condition2)
```

## Arguments

measure– The measure to filtered. Required.

periodRange – A period range array returned by the PERIOD\_RANGE function. Required.

condition1/condition2- A condition that must evaluate to TRUE or FALSE. Use the THIS keyword to refer to the current value. Required.

## Return value

Returns a range of measure values that satisfy the specified condition.

## Example

```javascript
FILTER([Sales], PERIOD_RANGE(DATE(2023,1,1),DATE(2023,12,31),THIS>1000)
//Returns the sales values in 2023 which are greater than 1000
```

In this sales report, we have used the FILTER function with SUM to aggregate only the cells that satisfy a certain condition. We are summing up the sales only when the sales is greater than 1000. The FILTER measure is blank for the "Fasteners" row as none of the cells have sales > 1000. Take a look at the "Envelopes" row. The sales for Q1 and Q4 satisfy the condition that sales should be > 1000; those two cells are returned by the FILTER function and summed up.

<figure><img src="https://github.com/lumelinc/PowerTableDocs/blob/main/.gitbook/assets/image%20(2614).png" alt=""><figcaption><p>FILTER</p></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.fabricplan.com/documentation/plan/planning-sheets/formula-syntax/time-intelligence-functions/filter.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
