Forum Discussion
Require help with creating 2 levels of Ranks
- 6 years ago
Hi Anonymous ,
Try the following measures:
Rank by District = IF ( HASONEVALUE ( Branch[Branch] ); RANKX ( ALLSELECTED ( Branch[Branch] ); ( [Ratio] );; ASC; SKIP ) ) Rank by Region = IF ( HASONEVALUE ( Branch[Branch] ); RANKX ( ALL ( Branch ); ( CALCULATE ( [Ratio] ) );; ASC; SKIP ) )The branch table is you location table. I'm assuming your Ratio is a measure, altough on the sample table you provide the calculation between wages and sales for district 2 is not matching.
Hi Anonymous ,
Try the following measures:
Rank by District =
IF (
HASONEVALUE ( Branch[Branch] );
RANKX ( ALLSELECTED ( Branch[Branch] ); ( [Ratio] );; ASC; SKIP )
)
Rank by Region =
IF (
HASONEVALUE ( Branch[Branch] );
RANKX ( ALL ( Branch ); ( CALCULATE ( [Ratio] ) );; ASC; SKIP )
)
The branch table is you location table. I'm assuming your Ratio is a measure, altough on the sample table you provide the calculation between wages and sales for district 2 is not matching.
hi MFelix - Thanks a lot for the help! I was able to tweak the measures to make it work but I notice that it not behaving as expected.
The District Rank works perfectly but the Region Rank works if it is in a separate table (table on the right - Region + Branch) but when I include it in the table (table on the left - Region + Metro + Branch) then it gives me the same values as the District Rank. 🤔
Can you please help me try and figure this one out.