Knowing when to use ALL and ALLSELECTED in DAX calculations can be very confusing, but really important in getting the correct numbers in the correct places.
ALL:
ALL ignores all filters applied to a table or column, regardless of where they came from (e.g. slicers, page filters, row headers, column headers). It returns the absolute grand total of the field given.
Example: Sales (ALL) = CALCULATE([Total Sales], ALL(Sales))
This will ignore the product category row headers and ignores all slicers (like countries) to return sales across all countries and all categories.
ALLSELECTED:
ALLSELECTED ignores filters applied inside the visual (e.g. row or column headers), but respects external filters applied outside the visual (slicers, page-level filters). It returns the total of the currently selected subset.
Example: Sales (ALLSELECTED) = CALCULATE( [Total Sales], ALLSELECTED(Sales))
This ignores the product category row headers, BUT respects slicers (like a country slicer) to return total sales for that country (the slicer used) across all categories.
Cheat Sheet Comparison
| Feature | ALL | ALLSELECTED |
| Ignores Row/Column Headers? | Yes | Yes |
| Ignores Slicers / Canvas Filters? | Yes | No (Respects them) |
| Denominator for % of Total | Overall Grand Total | Visible / Filtered Total |
| Primary Use Case | Baseline comparisons, benchmark metrics | Dynamic % of Total in visuals |
