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.
Would like to calculate the average of a column ("Score") then return it based on conditions (text).
Score |
1 |
5 |
7 |
9 |
10 |
3 |
The average would be 5.8333
However, would like it to refer to the rating_criteria info (below)
Rating_Criteria | |
8.1 to 10 | World Class |
7.6 - 8.0 | Excellent |
7.1 - 7.5 | Good |
6.5 - 7.0 | Average |
1.0 - 6.4 | Under-performing |
and return as per the criteria which to show "Under-Performing" please 🙂
Solved! Go to Solution.
@Anonymous
maybe you can try this
Measure =
VAR _avg=AVERAGE('Table'[Score])
return SWITCH(TRUE(),_avg>8.1,"world class",_avg>7.5,"Excellent",_avg>7.0,"Good",_avg>6.4,"Average","Under-performing")
Proud to be a Super User!
Excel formlua is concise enough to cope with this,
Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension! |
DAX is simple, but NOT EASY! |
@Anonymous
maybe you can try this
Measure =
VAR _avg=AVERAGE('Table'[Score])
return SWITCH(TRUE(),_avg>8.1,"world class",_avg>7.5,"Excellent",_avg>7.0,"Good",_avg>6.4,"Average","Under-performing")
Proud to be a Super User!
Worked like a charm!
Thank you
you are welcome
Proud to be a Super User!
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 |
---|---|
97 | |
96 | |
81 | |
74 | |
66 |
User | Count |
---|---|
126 | |
106 | |
105 | |
86 | |
72 |