Don't miss your chance to take exam DP-600 or DP-700 on us!
Request nowLearn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now
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.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
Check out the February 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 5 | |
| 4 | |
| 3 | |
| 3 | |
| 2 |