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
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 )
)
)
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 )
)
)
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.
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
Check out the November 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 20 | |
| 10 | |
| 9 | |
| 4 | |
| 4 |
| User | Count |
|---|---|
| 32 | |
| 31 | |
| 18 | |
| 12 | |
| 11 |