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 All, another new user here.
As the title suggests I have this concept of a league table where we are trying to rank users by a score.
I have 3 tables, uVw_New_Journeys which relates to a users table through user id and a dimensional table that relates to a date field.
I'm trying to get a ranking based on the months selected by user and their score. The following DAX I have scratched around at to see if I can get it working but I cannot:
Name | Rank | Score | Speeding |
Test1 | 1 | 98 | 100 |
Test5 | 2 | 90 | 90 |
Test3 | 3 | 90 | 80 |
Test7 | 4 | 90 | 70 |
Test2 | 5 | 88 | 90 |
Test4 | 6 | 86 | 88 |
Test6 | 7 | 82 | 90 |
Any help would be greatly appreciated.
@JamesBx , Check how to break ties using another column
https://databear.com/how-to-use-the-dax-rankx-function-in-power-bi/
Also, check
For Rank Refer these links
https://radacad.com/how-to-use-rankx-in-dax-part-2-of-3-calculated-measures
https://radacad.com/how-to-use-rankx-in-dax-part-1-of-3-calculated-columns
https://radacad.com/how-to-use-rankx-in-dax-part-3-of-3-the-finale
So turns out I was using the wrong column for the rankx, I also changed it to allselected for the user which has gotten me to the first hurdle. After bashing my head for a little while on this, i guess I just needed a little break and to look at it again to fix these rather obvious issues. Not sure how I go about adding in additional columns now though.
I am now at:
Hi @JamesBx
check this great article https://radacad.com/how-to-use-rankx-in-dax-part-2-of-3-calculated-measures
Thank you, so if im reading this correct, here they are using add function to add the values together, i have tried this, but its not quite correct as the two values could add up to more that a lower rank. It almost needs to be a waterfall approach. Is the divide by 10000 doing this function that is described as a "technique" in this article? To quote:
"The additional code is line 10, which extends the <expression> using a technique that makes the result of each <expression> unique without upsetting the initial sort order."
Here is one way to write this measure using the sample data you provided.
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
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 |
---|---|
111 | |
97 | |
82 | |
67 | |
61 |
User | Count |
---|---|
148 | |
113 | |
97 | |
84 | |
67 |