March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
I am trying to rank different stores based on Sales. These stores are also broken out by Country, Region, District.
I would like to be able to rank the countries against each other, the Regions, and the districts.
Something like this all in one matrix. What would be the correct Formula for this?
USA 1 RANK 1
US Central RANK 2
STORE 1 RANK2
STORE 3 RANK 3
STORE 4 RANK 1
US EAST RANK 1
US South RANK 3
China RANK 3
Canada RANK 2
Solved! Go to Solution.
Hi @Anonymous,
Nope, you can't direct write a simple formula to achieve multiple level ranking.
In my opinion, your formula should nested with multiple ranking formulas based on each level and concatenate by if statement. After these, you can use if statement to check current level and use correspond ranking formula.
You can take a look at below is a blog, it told about how to use if statement to check current hierarchy level.
Clever Hierarchy Handling in DAX
Regards,
Xiaoxin Sheng
Hi @Anonymous,
Nope, you can't direct write a simple formula to achieve multiple level ranking.
In my opinion, your formula should nested with multiple ranking formulas based on each level and concatenate by if statement. After these, you can use if statement to check current level and use correspond ranking formula.
You can take a look at below is a blog, it told about how to use if statement to check current hierarchy level.
Clever Hierarchy Handling in DAX
Regards,
Xiaoxin Sheng
Thanks @v-shex-msft Xiaoxin.... That did the trick...
Here was my final dax formula.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
123 | |
85 | |
85 | |
70 | |
51 |
User | Count |
---|---|
205 | |
153 | |
97 | |
79 | |
69 |