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
Proud to be a Super User!
Solved! Go to Solution.
Hi @Sumanth_23 ,
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.
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsSorry for some reason could not put in the sample data and desired output in the original post - looking to calculate Column G & H in the below screenshot
Regards,
Sumanth
Proud to be a Super User!
Hi @Sumanth_23 ,
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.
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em Portuguêshi @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.
Proud to be a Super User!
Measures are based on context so you need to add the additional level to your rankx in the allselected part
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em Portuguêshi @MFelix - Thanks that did the trick!! 👍 Was having a bit of a brain breeze moment 😊
Proud to be a Super User!
hi @MFelix - Thank you for your quick response; I shall give this a shot and get back to you..
Also yes, Ratio is a measure - the mock data got a little messed up. Thanks!
Proud to be a Super User!
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 |
|---|---|
| 59 | |
| 46 | |
| 42 | |
| 23 | |
| 18 |
| User | Count |
|---|---|
| 193 | |
| 124 | |
| 101 | |
| 67 | |
| 49 |