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 Folks,
Need help on the ranking formula . As per the need :-
1. We need to show ranking as per Product and price from higher to lower i.e higher value should be 1 and then goes on ....
2. We need to show all city in the same row of a particular product. For example:- Pls find the snips
Case 1-
Case 2 -
For ranking i am trying to write DAX as
1.
Kinldy help me to solve this
rank = RANKX( FILTER( data, AND( data[Product] = EARLIER(data[Product]), data[City] = EARLIER(data[City]))), data[Price], , Dense)
--Try this one hope it works
Did I answer your question? If so, please mark my post as a solution!
Proud to be a Super User!
@MH
Hi ,
This is not working as passing more than 2 argument in filter function is not accepting
Snip
For case 1 could you try this please?
Ranking = VAR healthcare_products = FILTER('Table', 'Table'[Product] = "Healthcare") RETURN RANKX(healthcare_products, healthcare_products[Sales], , DESC, Dense)
let me know if this gives desired result, if so I should be able to do case 2 🙂
Hi @Anonymous
I tried this with a minor changes in the DAX but still showing the wrong ranking for Pharmacy in Pune . PLs find below snip
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 39 | |
| 38 | |
| 38 | |
| 28 | |
| 27 |
| User | Count |
|---|---|
| 124 | |
| 88 | |
| 73 | |
| 66 | |
| 65 |