Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more
Hi everyone,
Hope maybe you can help? I am trying to build Rankx measure but it keeps coming back with 1 to 66 🙂
This is the dax i tried:
Ranking = RANKX(ALLSELECTED('Agent level stats'), CALCULATE(SUM('Agent level stats'[Number of Calls Handled])),,DESC,Dense)
i've also tried this one, where total Calls is a measure of "Total Calls = SUM('Agent level stats'[Number of Calls Handled])" and then this one:
Rank = RANKX(ALL('Agent level stats'),[Total Calls],,DESC,Dense)
Do you see anything wrong with my measure?
Thanks a million.
Solved! Go to Solution.
@Erika_S ,
formulas
Calls = SUM('Table'[Number of Calls Handled])
Rank = rankx(ALLSELECTED('Table'[Agent ID]),[Calls],,DESC,Dense)
what it is showing
Yes, thank you all. Here is the data sample attached.
Here is what i would expect to see. Ranked based on who took the most calls. I woud then hope to introduce another column into the calculation. But want to get the initial one to work 🙂 Rank in the table if for illustration, not the actual rank.
| Agent ID | Rank |
| 1 | 5 |
| 2 | 6 |
| 3 | 3 |
| 4 | 2 |
| 5 | 4 |
| 6 | 1 |
Here is the example: (so sorry, i cant see where to attach pbix or worksheet).
| Agent ID | Number of Calls Handled | Total Call Time (secs) |
| 1 | 32 | 0 |
| 2 | 3 | 0 |
| 3 | 6 | 0 |
| 4 | 9 | 0 |
| 4 | 3 | 1864 |
| 4 | 1 | 191 |
| 4 | 9 | 244 |
| 5 | 1 | 98 |
| 5 | 14 | 2966 |
| 5 | 14 | 2974 |
| 5 | 14 | 3283 |
| 5 | 15 | 2916 |
| 5 | 36 | 8908 |
| 5 | 37 | 6354 |
| 5 | 46 | 10908 |
| 5 | 71 | 14398 |
| 5 | 74 | 9570 |
| 5 | 78 | 17655 |
| 6 | 15 | 4481 |
| 6 | 15 | 5238 |
| 6 | 16 | 2987 |
| 6 | 16 | 3266 |
| 6 | 16 | 3456 |
| 6 | 16 | 3559 |
| 6 | 16 | 3672 |
| 6 | 16 | 3712 |
| 6 | 16 | 3760 |
Hi @Erika_S ,
Create a measure
This almost worked! I have added "Dense" as it was showing the bottom few as all on Rank 20. Dense didnt help though.
I couldnt open pbix - says my version is too old:( so sorry...
@Erika_S ,
formulas
Calls = SUM('Table'[Number of Calls Handled])
Rank = rankx(ALLSELECTED('Table'[Agent ID]),[Calls],,DESC,Dense)
what it is showing
@Erika_S , Measure seems to fine at a high level. Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.
What is wrong , what is expected
@Erika_S - I agree with @vanessafvg , sample data and expected output please. This may help in the mean time https://community.powerbi.com/t5/Quick-Measures-Gallery/To-Bleep-with-RANKX/m-p/1042520#M452
Proud to be a Super User!
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.