Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
Dear Respected Sirs & Experts,
I need Rankx for mian category then for furhtermore 4 sub category (Rank for 2 Region then 7 Zone then 24 Branches and then 45 Area Sales Offiers) , please guide how to do this ?
Reference data is attached.
https://drive.google.com/file/d/18ULxB7JdQXjqQszXQHw9BQ28lazJsD5X/view?usp=sharing
Thank You so much for support.
Desire Result Page 1
Desire Result Page 2
Solved! Go to Solution.
Hi,
Based on what you shared, one of ways to create a measure is like below.
ISINSCOPE function (DAX) - DAX | Microsoft Learn
RANK function (DAX) - DAX | Microsoft Learn
Rank =
SWITCH (
TRUE (),
ISINSCOPE ( ASO[ASO Name] ),
RANK (
SKIP,
ALL ( ASO[ASO Name], ASO[Branch], ASO[Zone], ASO[Region] ),
ORDERBY ( CALCULATE ( SUM ( ASO[Sales Ach] ) ), DESC )
),
ISINSCOPE ( ASO[Branch] ),
RANK (
SKIP,
ALL ( ASO[Branch], ASO[Zone], ASO[Region] ),
ORDERBY ( CALCULATE ( SUM ( ASO[Sales Ach] ) ), DESC )
),
ISINSCOPE ( ASO[Zone] ),
RANK (
SKIP,
ALL ( ASO[Zone], ASO[Region] ),
ORDERBY ( CALCULATE ( SUM ( ASO[Sales Ach] ) ), DESC )
),
ISINSCOPE ( ASO[Region] ),
RANK (
SKIP,
ALL ( ASO[Region] ),
ORDERBY ( CALCULATE ( SUM ( ASO[Sales Ach] ) ), DESC )
)
)
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
Excellent Its work in a great manner. Thank You So much Sir Jihwan_Kim. Jazak Allah Kher.
Hi,
Based on what you shared, one of ways to create a measure is like below.
ISINSCOPE function (DAX) - DAX | Microsoft Learn
RANK function (DAX) - DAX | Microsoft Learn
Rank =
SWITCH (
TRUE (),
ISINSCOPE ( ASO[ASO Name] ),
RANK (
SKIP,
ALL ( ASO[ASO Name], ASO[Branch], ASO[Zone], ASO[Region] ),
ORDERBY ( CALCULATE ( SUM ( ASO[Sales Ach] ) ), DESC )
),
ISINSCOPE ( ASO[Branch] ),
RANK (
SKIP,
ALL ( ASO[Branch], ASO[Zone], ASO[Region] ),
ORDERBY ( CALCULATE ( SUM ( ASO[Sales Ach] ) ), DESC )
),
ISINSCOPE ( ASO[Zone] ),
RANK (
SKIP,
ALL ( ASO[Zone], ASO[Region] ),
ORDERBY ( CALCULATE ( SUM ( ASO[Sales Ach] ) ), DESC )
),
ISINSCOPE ( ASO[Region] ),
RANK (
SKIP,
ALL ( ASO[Region] ),
ORDERBY ( CALCULATE ( SUM ( ASO[Sales Ach] ) ), DESC )
)
)
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
Hi Jihwan_Kim,
Thank for first solution, when i used this solution as discussed before its working excellent but when i used this DAX measure with New parameter command in Modeling Tab by filtered Region, Zone, Branhes and Area Sales Offier seperattarly (Pic attached) then Dax measure missed some rankings in Area sales officer and branches but region and zone is OK, i try to fix it but i no idea why this happen.
Region and Zone Ranking is OK
No 3 rank is missing and Rank 1 is not calculated in Branch level ranking
ASO level 4 ranking is missing and start ranking from rank no 4
Excellent Its work in a great manner. Thank You So much Sir Jihwan_Kim. Jazak Allah Kher.
User | Count |
---|---|
20 | |
20 | |
15 | |
10 | |
7 |
User | Count |
---|---|
28 | |
28 | |
13 | |
12 | |
12 |