Forum Discussion
How to get Rank value in multiple column combination?
Hi, Someone assist me, how do I get Ranking for multiple columns combination. for example, I have Country, Product and Sales amount columns are available in dataset.
I tried the below code and its not working
Ranking = RANKX(ALL('SalesData'[Country]), [SalesAmt])
for your reference, source data is below
I want to output like
How to change this code
Ranking = RANKX(ALL('SalesData'[Country]), [SalesAmt])
regards,
Ram
Ranking = RANKX(ALL('SalesData'[Country], 'SalesData'[product]), [SalesAmt])
or
Ranking = RANKX(filter(ALL('SalesData'[Country], 'SalesData'[product]),[Country] =max([Country]) , [SalesAmt])
or create two ranks one on product and one on the country and switch them using isinscope
https://www.kasperonbi.com/use-isinscope-to-get-the-right-hierarchy-level-in-dax/
1 Reply
- amitchandak
Super User
Ranking = RANKX(ALL('SalesData'[Country], 'SalesData'[product]), [SalesAmt])
or
Ranking = RANKX(filter(ALL('SalesData'[Country], 'SalesData'[product]),[Country] =max([Country]) , [SalesAmt])
or create two ranks one on product and one on the country and switch them using isinscope
https://www.kasperonbi.com/use-isinscope-to-get-the-right-hierarchy-level-in-dax/