FILTER, ALL and ALLEXCEPT
Control and remove filter context with FILTER, ALL, ALLEXCEPT and ALLSELECTED
These three functions are used inside CALCULATE to precisely control which filters are active when a measure is evaluated. Mastering them means you can build any conditional metric — % of total, comparison to a fixed benchmark, metrics that ignore specific slicers.
FILTER() — creates a table of rows that satisfy a condition
ALL() — returns a table with all filters removed
ALLEXCEPT() — removes all filters except specified columns
ALLSELECTED() — returns values currently visible (respects outer filters but ignores inner)
Examples
Key Points
- ✓ALL() is the most common way to calculate "% of total" in Power BI
- ✓FILTER() takes a table and a condition — returns only matching rows
- ✓ALLEXCEPT() is useful for "keep this dimension's filter, remove all others"
- ✓ALLSELECTED() calculates against what is currently visible to the user
- ✓These functions are always used inside CALCULATE — never on their own in a measure
Practice Question
You want to calculate "Sales as % of Grand Total" that ignores all slicers. Which formula is correct?
Related Topics
CALCULATE — The Most Important DAX FunctionMaster CALCULATE to control filter context and build any business metric in Power BITime Intelligence in DAXCalculate YTD, MTD, same period last year, and MoM growth using DAX time functionsRow-Level Security (RLS) in Power BIRestrict data access by user — so each person only sees their own region or team data