Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi There,
I need help with the ranking. I tried to search similar issues, but still stuck at this formula.
This is my current formula and the output:
The rank for total Quantity is perfect, but I still need the rank of each year.
I don't know how can Qty 117 and Qty 140 in Year#3 both become rank#1.
Should the Column"Year" be in the formula? If so, where should it be?
Solved! Go to Solution.
Hi , @kusanagi
According to your dax code, normally it can work in my understand .
I use your dax code in my side , it works good , and this is my test data:
When i use this dax code :
So i think it may cause by the other reason in your side.
You can try to use this dax code :
Measure = IF( HASONEVALUE('Table'[Item]) , RANKX(SELECTCOLUMNS(CALCULATETABLE( 'Table' , ALLSELECTED('Table'[Item]) ),"Item",[Item]) , [Qty] ,,DESC,Dense))
If you still can not solve this problem , can you share the sample .pbix file to me (without sensitive data in it) so that i can test it in my side.
Thank you for your time and sharing, and thank you for your support and understanding of PowerBI!
Best Regards,
Aniya Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi , @kusanagi
According to your dax code, normally it can work in my understand .
I use your dax code in my side , it works good , and this is my test data:
When i use this dax code :
So i think it may cause by the other reason in your side.
You can try to use this dax code :
Measure = IF( HASONEVALUE('Table'[Item]) , RANKX(SELECTCOLUMNS(CALCULATETABLE( 'Table' , ALLSELECTED('Table'[Item]) ),"Item",[Item]) , [Qty] ,,DESC,Dense))
If you still can not solve this problem , can you share the sample .pbix file to me (without sensitive data in it) so that i can test it in my side.
Thank you for your time and sharing, and thank you for your support and understanding of PowerBI!
Best Regards,
Aniya Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 39 | |
| 37 | |
| 33 | |
| 32 | |
| 29 |
| User | Count |
|---|---|
| 132 | |
| 88 | |
| 82 | |
| 68 | |
| 64 |