Forum Discussion
DAX confusion
- 1 month ago
Quick way to think about the three:
ALL(table or column) removes all filters from what you point it at. Use it when you need the full unfiltered denominator, like a percent of grand total.
ALLEXCEPT(table, col1, col2, ...) removes filters from the table except on the columns you list. Handy for percent within category measures where you want to keep the category context but drop everything else.
ALLSELECTED(table or column) respects filters that live outside the visual (slicers, page filters) but ignores filters coming from inside the current visual. That gives you a percent of visible total that reacts to slicers.
So as a rule of thumb: ALL for percent of grand total, ALLEXCEPT for percent inside a specific group, and ALLSELECTED for percent of whatever the user has selected.
If this helped, kindly mark it as the solution and give a thumbs up.
Best,
Shai Karmani - 1 month ago
@powerbidev123 Without getting into all the gritty details because ALLSELECTED gets weird.
ALL removes all filters both inside the visual as well as coming from outside the visual.
ALLSELECTED removes all filters inside the visual but not those coming from outside the visual.
ALLEXCEPT removes all filters except for those specified.
Quick way to think about the three:
ALL(table or column) removes all filters from what you point it at. Use it when you need the full unfiltered denominator, like a percent of grand total.
ALLEXCEPT(table, col1, col2, ...) removes filters from the table except on the columns you list. Handy for percent within category measures where you want to keep the category context but drop everything else.
ALLSELECTED(table or column) respects filters that live outside the visual (slicers, page filters) but ignores filters coming from inside the current visual. That gives you a percent of visible total that reacts to slicers.
So as a rule of thumb: ALL for percent of grand total, ALLEXCEPT for percent inside a specific group, and ALLSELECTED for percent of whatever the user has selected.
If this helped, kindly mark it as the solution and give a thumbs up.
Best,
Shai Karmani