Forum Discussion
Unexpected ALL() Behavior
Hi everyone,
I am a DAX beginner and I have been having an issue understanding the ALL() function.
Take for example this scenario from the titanic dataset:
So what I would like to display is:
1. Port of embarkation
2. Sex
3. Survived
4. Total number of people that boarded the boat at each port, who survived, irrespective of sex.
So my DAX measure for the variable "Total survived passengers embarked at port" is
Anonymous
In your example did you pull the sex column into the visual from the Sex table or the Train table? You should pull it from the Sex table then I believe your view will work.
4 Replies
- jdbuchanan71Super User
Anonymous
In your example did you pull the sex column into the visual from the Sex table or the Train table? You should pull it from the Sex table then I believe your view will work.
- AnonymousNot applicableThank you yes, thats true!
- AnonymousNot applicable
Hi Anonymous ,
https://radacad.com/how-to-use-all-in-a-dax-expression-in-power-bi
Explains the usage of ALL().
Regards,
Harsh Nathani
Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)
- AnonymousNot applicable
Hi everyone,
Thank you for all your answers, they were really helpful.
However, I also found out that if your dimension table contains an "order" column, you need to include the order with the ALL() expression as well for it to work properly.
For instance, if the sex table had a column that looks at the order of male and female to display in a certain way, you would want the expression to be as follows:
Total survived passengers embarked at port = CALCULATE(sum(train[Survived]), all(sex[Sex],sex[Order]))