DAX function
ALLSELECTED — DAX function reference
Respect slicer/outer selection.
Syntax
dax
ALLSELECTED(<table> | <column1> [, <column2>, …] | )
Examples
dax
CALCULATE(SUM(Sales[Amount]), ALLSELECTED(Sales[Region]))
→ A number
dax
DIVIDE(SUM(Sales[Amount]), CALCULATE(SUM(Sales[Amount]), ALLSELECTED(Sales)))
→ Percent of the visible (sliced) total, not the whole table
The argument-less form resets to the query's outer filter context rather than a specific table.
dax
CALCULATE([Total Sales], ALLSELECTED())
→ Total for everything currently selected in the report
Common mistakes & gotchas
- Use for percent-of-visible-total so slicers still apply.
- ALLSELECTED restores the filter in effect outside the visual's own row/column context, not simply 'current slicer state' — its exact behavior depends on the query context Power BI builds for the visual, which can surprise people in matrix subtotal rows.
- ALL ignores every filter for a true grand total; ALLSELECTED respects report-level filters/slicers but ignores the visual’s internal grouping — mixing them up is the top cause of a percent-of-total that doesn’t sum to 100%.
Related DAX functions
From Filter context