Overview
The ALL family removes or ignores parts of the filter context so measures can show totals, rankings, or percentages that behave correctly inside visuals and slicers.
Control how measures obey slicers and visual row filters.
On this page
The ALL family removes or ignores parts of the filter context so measures can show totals, rankings, or percentages that behave correctly inside visuals and slicers.
// Remove all filters on the Product table
ALL ( Product )
// Remove filters on Category only
ALL ( Product[Category] )
// Use inside CALCULATE
% of Total Sales =
DIVIDE(
[Total Sales],
CALCULATE( [Total Sales], ALL ( Product[Category] ) )
)// Keep Category filter, remove Product and other columns
ALLEXCEPT ( Product, Product[Category] )
Rank in Category =
RANKX(
ALLEXCEPT ( Product, Product[Category] ),
[Total Sales],
,
DESC
)% of Selected Total =
DIVIDE(
[Total Sales],
CALCULATE( [Total Sales], ALLSELECTED ( Product ) )
)
// Often used with KEEPFILTERS for advanced patterns
CALCULATE(
[Total Sales],
ALLSELECTED ( 'Date'[Year] )
)ALL vs ALLEXCEPT vs ALLSELECTED
| DAX Function | Obeys Page Slicers? | Obeys Visual Row Filters? | Primary Use Case |
|---|---|---|---|
| ALL | No | No | Grand totals, global ranks, remove all context on columns |
| ALLEXCEPT | No | Yes (for kept columns) | Subtotals within a dimension (rank in category) |
| ALLSELECTED | Yes | No (inside visual) | % of what the user filtered on the page |