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.
I'm trying to write dax to calculate the number of people who went skiing and scored an average of 3 or above. The average is calculated for all tricks. This would mean that Bob = 4.5, Jim = 3, Alan = 4, and Jen = 1. The number of people above a 3 average is 3 people.
For the sample table below, that would be
Unfortunately, my DAX is giving me 4 people, because Bob is being double counted.
DAX I've written:
Skiiers above average of 3 = CALCULATE(DISTINCTCOUNT(Name,
filter('Ski',Average([Score]) >= 3), All([Activity]))
I tried using All([Tricks]) as well & I've tried AllEXCEPT on Tricks and Activity, but I cannot keep Bob from being counted twice.
Could someone please provide me with some insight?
Thanks!
Solved! Go to Solution.
Hi @tasmiaa,
Please try this measure:
Skiiers above average of 3 = CALCULATE ( DISTINCTCOUNT ( [Name] ), FILTER ( 'Ski', CALCULATE ( AVERAGE ( [Score] ), ALLEXCEPT ( ski, ski[Name] ) ) >= 3 ) )
Best regards,
Yuliana Gu
Hi @tasmiaa,
Please try this measure:
Skiiers above average of 3 = CALCULATE ( DISTINCTCOUNT ( [Name] ), FILTER ( 'Ski', CALCULATE ( AVERAGE ( [Score] ), ALLEXCEPT ( ski, ski[Name] ) ) >= 3 ) )
Best regards,
Yuliana Gu
Thank you!
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 |
---|---|
112 | |
97 | |
85 | |
68 | |
59 |
User | Count |
---|---|
150 | |
120 | |
100 | |
87 | |
68 |