Forum Discussion
How to get ranking
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
4 Replies
- AnonymousNot applicable
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 🙂
- Sajid02
Helper I
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
- mh2587
Super User
rank = RANKX( FILTER( data, AND( data[Product] = EARLIER(data[Product]), data[City] = EARLIER(data[City]))), data[Price], , Dense) --Try this one hope it works