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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

How can I visualize the ranking of the region?

Hello all, I have trade data from the 17 regions. I want to create a measure that shows the place of the region based on trade values. For example, NY - 170 $, CA - 180 $, PA - 150$, and if I select PA it should show me 3rd place or 3/3, if NY 2nd place or 2/3 and finally CA 1st place or 1/3. How can I handle this?

1 ACCEPTED SOLUTION

Hi @Anonymous ,

 

Please refer to the measure below:

 

 

RANK = 

RANKX(
    ALLSELECTED('Table'),
    CALCULATE(SUM('Table'[VALUE])),,DESC
)

 

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Best Regards,

Dedmon Dai

View solution in original post

7 REPLIES 7
amitchandak
Super User
Super User
Fowmy
Super User
Super User

@Anonymous 

Try this measure to rank.

RANK = 

RANKX(
    ALL('Table'),
    CALCULATE(SUM('Table'[VALUE])),,DESC
)

 

________________________

Did I answer your question? Mark this post as a solution, this will help others!.

Click on the Thumbs-Up icon on the right if you like this reply 🙂

YouTube, LinkedIn

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Anonymous
Not applicable

@Fowmy Thanks for your reply, it works fine. But I encountered one problem. With all regions, I have also Total for the counter inside in the region column. For example, NY - 150$, CA - 180$, PA-140$, ALL regions - 470 $ (150+180+140). And I set visual filter not to show ALL regions for all my pages in power bi reports. Currently, this:

RANK = RANKX( ALL('Table'), CALCULATE(SUM('Table'[VALUE])),,DESC )

 is showing me CA as 2nd place, NY as 3 and PA as 4th place because of ALL regions. How can I eliminate All regions when ranking, so I want to CA as 1st place. Thanks

@Anonymous 

Modified Measure:

RANK = 
IF( 
    SELECTEDVALUE('Table'[REGION]) = "ALL REGIONS",
    BLANK(),
    RANKX(
        FILTER(ALL('Table'),'Table'[REGION] <> "ALL REGIONS"),
        CALCULATE(SUM('Table'[VALUE])),,DESC
    )
)

 

________________________

Did I answer your question? Mark this post as a solution, this will help others!.

Click on the Thumbs-Up icon on the right if you like this reply 🙂

YouTube, LinkedIn

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Anonymous
Not applicable

@Fowmy  Now when All regions selected it is Blank, but if I select regions for all the measure is equal to 1.

Please note that I applied  Region except All regions filter for all pages using the visual filter = Снимок.PNG

 

This means that ALL regions excluded from everywhere.

Hi @Anonymous ,

 

Please refer to the measure below:

 

 

RANK = 

RANKX(
    ALLSELECTED('Table'),
    CALCULATE(SUM('Table'[VALUE])),,DESC
)

 

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Best Regards,

Dedmon Dai

@Anonymous 

Not quite what you are trying to do, either you can share the file or provide a clear explanation to understand further.

You can save your files in OneDrive, Google Drive, or any other cloud sharing platforms and share the link here.
____________________________________
How to paste sample data with your question?
How to get your questions answered quickly?

_____________________________________
Did I answer your question? Mark this post as a solution, this will help others!.

Click on the Thumbs-Up icon on the right if you like this reply 🙂

YouTube, LinkedIn

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.