DAX function
FILTER — DAX function reference
Return rows matching a condition.
Syntax
dax
FILTER(<table>, <condition>)
Examples
dax
FILTER(Sales, Sales[Amount] > 1000)
→ A table
FILTER is needed here because the condition compares two columns, which a simple boolean filter argument can't express.
dax
CALCULATE(SUM(Sales[Amount]), FILTER(Sales, Sales[Amount] > RELATED(Product[TargetPrice])))
→ Sum of orders sold above the product’s target price
Pairs FILTER with ALL to build a modified filter that ignores the report’s current selection.
dax
FILTER(ALL(Product), Product[Category] = "Bikes")
→ All Bikes products, ignoring the visual's own category filter
Common mistakes & gotchas
- Iterates row by row. Inside CALCULATE prefer a simple boolean filter when you can — FILTER is slower.
- FILTER always does a row-by-row scan of its table argument, so filtering a huge fact table directly (FILTER(Sales, …)) inside CALCULATE is much slower than an equivalent simple boolean filter like Sales[Region] = "West" — reserve FILTER for conditions a boolean filter can’t express.
- FILTER(Sales, …) inside CALCULATE further restricts whatever filter context already exists on Sales rather than replacing it — combine with ALL if you need to start from an unfiltered table.
Related DAX functions
From Filter context