Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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
Solved! Go to Solution.
@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.
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]))
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)
@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.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
113 | |
97 | |
80 | |
69 | |
59 |
User | Count |
---|---|
150 | |
119 | |
104 | |
87 | |
67 |