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!Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!
I am trying to write the DAX to get a ranking of stores based on sales. The code provided calculates the rank of stores based on their total weekly deals in the 'sales data-set'. But i am geting the same rank (rank 1) for all rows below is the code:-
I am trying to get the ranking I can use to do TOP N analysis where N is coming from the parameter.
Solved! Go to Solution.
Hi@mlsx4, Could you please let me know why it was necessary to add 'sales data-set'[Store] instead of 'sales data-set'?
Oh, I have used ALLSELECTED instead of ALL (It was a try).
I have seen that it doesn't work. What have you written in the measure [Sum of weekly..]?
It is something silly but using dummy data it works...can you try to do this?
Rank of Stores =
RANKX
(
ALL('sales data-set'), -- Replace 'Stores' with the appropriate table name
CALCULATE (SUM ('sales data-set'[column])),
,DESC
,Dense
)
Hi @prashant21
Try with:
Rank of Stores =
RANKX
(
ALLSELECTED('sales data-set'[Store]), -- Replace 'Stores' with the appropriate table name
[Sum of Weekly Sales],
,DESC
,Dense
)
Hi, Still getting the same issue
Vote for your favorite vizzies from the Power BI World Championship submissions!
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 64 | |
| 51 | |
| 46 | |
| 23 | |
| 19 |
| User | Count |
|---|---|
| 139 | |
| 112 | |
| 51 | |
| 33 | |
| 29 |