Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
bhurru
Helper I
Helper I

National ,Regional and Territory Ranks

Greeting Folks!

 

My question might have been asked previously in the forum, however I didn't get a solution.

I have a measure which ranks by Region(3 distinct region , 18 distinct District and 130 distinct Territory.

 

I have to show 2 ranks

1. Rank when no filter is applied(i.e. Rank for all Region,All District and all Territory)

2. Rank which gets affected by Region, District and Territory filters (slicers)

 

Below is a snip of what I want to acheive :

bhurru_0-1604060313463.png

Boosted S2 GA is the measure . So Rank column should get affected from Region,territory and District slicer and Rank Region National and Rank District National should remain same and unaffected by Region,District and Territory slicers.

 

Example : When Region Slicer is filtered to Northeast , Rank should be 1 and Rank Region National should be 2.

Similarly Rank in below table should be based on Districts filtered under Northeast region(slicer). If only 1 dostrict then 1 otherwise rank based on Measure for those filtered districts.

 

 

Any help is highly appreciated

 

regards,

3 REPLIES 3
Anonymous
Not applicable

Hi @bhurru,

I'd like to suggest you take a look at the following blog about all functions, it may help you to understand these formulas and know more about how they work:
Managing “all” functions in DAX: ALL, ALLSELECTED, ALLNOBLANKROW, ALLEXCEPT 

Regards,

Xiaoxin Sheng

amitchandak
Super User
Super User

@bhurru , Meausre Rank is context sensitive

for the first one

rankx(All(Table[region]),[meausre])

rankx(Allselected(Table[region]),[meausre])

 

For second table

rankx(filter(Allselected(Table[region]),Table[district] =max(Table[district])),[meausre])

rankx(filter(All(Table[region]),Table[district] =max(Table[district])),[meausre])

 

For Rank Refer these links
https://radacad.com/how-to-use-rankx-in-dax-part-2-of-3-calculated-measures
https://radacad.com/how-to-use-rankx-in-dax-part-1-of-3-calculated-columns
https://radacad.com/how-to-use-rankx-in-dax-part-3-of-3-the-finale
https://community.powerbi.com/t5/Community-Blog/Dynamic-TopN-made-easy-with-What-If-Parameter/ba-p/3...

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Thanks ..but it didn't worked.

I get 1s across rows

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.