Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Dear Sirs & Experts,
I want a DAX measure that can calculate Ranking for Main Category then furthermore 3 sub-categories based on %.
Necessary Reference Files and expected results is attached below link (Excel and pbix):
https://drive.google.com/file/d/1XOUWo-EyXJVcT1_6LPCWgc38pn0dkUnP/view?usp=sharing
OLD ISSUE:
Jihwan_Kim (The Super User of community) have solve the issue before and give solution but now a little bit change in design of dashboared therefore the below DAX measure is not work properly (when i used old below give 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.) ... please guide me how to solve hte issue:
Previous issue link: Solved: RANKX for Main Category then for furthermore 4 sub... - Microsoft Fabric Community
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 ) ) )
Necessary Reference Files and expected results is attached below link (Excel and pbix):
https://drive.google.com/file/d/1XOUWo-EyXJVcT1_6LPCWgc38pn0dkUnP/view?usp=sharing
Dashboard Main Working
Expected Results
@ Jihwan_Kim @Ashish_Mathur @amitchandak
@ FreemanZ
Solved! Go to Solution.
Hi @123abc ,
According to your description, here are my steps you can follow as a solution.
(1) My test data is the same as yours.
(2) We can create a measure.
Rank =
SWITCH (
TRUE (),
ISINSCOPE ( 'unique keys'[ASO Name] ),
RANK (
SKIP,
ALL ( 'unique keys'[ASO Name], 'unique keys'[Branch], 'unique keys'[Zone], 'unique keys'[Region] ),
ORDERBY ( CALCULATE ( SUM ('Sales data'[Sales Ach] ) ), DESC )
),
ISINSCOPE ( 'unique keys'[Branch] ),
RANK (
SKIP,
ALL ( 'unique keys'[Branch], 'unique keys'[Zone], 'unique keys'[Region] ),
ORDERBY ( CALCULATE ( SUM ('Sales data'[Sales Ach] ) ), DESC )
),
ISINSCOPE ( 'unique keys'[Zone] ),
RANK (
SKIP,
ALL ( 'unique keys'[Zone], 'unique keys'[Region] ),
ORDERBY ( CALCULATE ( SUM ( 'Sales data'[Sales Ach] ) ), DESC )
),
ISINSCOPE ( 'unique keys'[Region] ),
RANK (
SKIP,
ALL ( 'unique keys'[Region] ),
ORDERBY ( CALCULATE ( SUM ( 'Sales data'[Sales Ach] ) ), DESC )
)
)
(3) Then the result is as follows.
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thank YOu Very Mcuh, Its work in great manner. May God Bless You Amin.
Hi @123abc ,
According to your description, here are my steps you can follow as a solution.
(1) My test data is the same as yours.
(2) We can create a measure.
Rank =
SWITCH (
TRUE (),
ISINSCOPE ( 'unique keys'[ASO Name] ),
RANK (
SKIP,
ALL ( 'unique keys'[ASO Name], 'unique keys'[Branch], 'unique keys'[Zone], 'unique keys'[Region] ),
ORDERBY ( CALCULATE ( SUM ('Sales data'[Sales Ach] ) ), DESC )
),
ISINSCOPE ( 'unique keys'[Branch] ),
RANK (
SKIP,
ALL ( 'unique keys'[Branch], 'unique keys'[Zone], 'unique keys'[Region] ),
ORDERBY ( CALCULATE ( SUM ('Sales data'[Sales Ach] ) ), DESC )
),
ISINSCOPE ( 'unique keys'[Zone] ),
RANK (
SKIP,
ALL ( 'unique keys'[Zone], 'unique keys'[Region] ),
ORDERBY ( CALCULATE ( SUM ( 'Sales data'[Sales Ach] ) ), DESC )
),
ISINSCOPE ( 'unique keys'[Region] ),
RANK (
SKIP,
ALL ( 'unique keys'[Region] ),
ORDERBY ( CALCULATE ( SUM ( 'Sales data'[Sales Ach] ) ), DESC )
)
)
(3) Then the result is as follows.
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thank YOu Very Mcuh, Its work in great manner. May God Bless You Amin.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
15 | |
10 | |
10 | |
10 | |
10 |
User | Count |
---|---|
19 | |
14 | |
13 | |
11 | |
8 |