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
AaronGlenn10
Helper III
Helper III

Ranking & Dynamic Title Help

I have a matrix with a list of restauraunt locations based on the City in the Selection Slicer.

 

Trying to accomplish two things:

1.) Only want to see Rankings when a restaurant is selected [in the screenshot below, if the user deselected the restaurnat location then the "Location Rank in City" would go away/disapper; and,

2.) Trying to figure out how to rank the restaurant against all locations in the State.

 

This measure provides the ranking within the Selected City ->

Location Rank in City = CALCULATE ( If( NOT (ISBLANK ([TABC Sales (CY)])), Rankx (filter (ALL(TABC[Location Name/City/Number]), NOT(isblank([TABC Sales (CY)]))), [TABC Sales (CY)])))

 

AaronGlenn10_0-1645147687042.png

 

Thank you!

1 ACCEPTED SOLUTION
v-kkf-msft
Community Support
Community Support

Hi @AaronGlenn10 ,

 

Please try the following formula:

 

Location Rank in State = 
CALCULATE (
    [Location Rank in City],
    REMOVEFILTERS ( TABC[City] ),
    KEEPFILTERS ( TABC[State] = MAX ( TABC[State] ) )
)

vkkfmsft_0-1645516614492.png

 

If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
v-kkf-msft
Community Support
Community Support

Hi @AaronGlenn10 ,

 

Please try the following formula:

 

Location Rank in State = 
CALCULATE (
    [Location Rank in City],
    REMOVEFILTERS ( TABC[City] ),
    KEEPFILTERS ( TABC[State] = MAX ( TABC[State] ) )
)

vkkfmsft_0-1645516614492.png

 

If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

AaronGlenn10
Helper III
Helper III

Thank you.

 

The rank for LOCATION within a CITY [e.g., #5 in the City of Dallas] works great, however, still can't resolve how to rank the LOCATION within the ENTIRE STATE of TEXAS.  Any guidance would be much appreciated.

 

AaronGlenn10_0-1645187031033.png

 

amitchandak
Super User
Super User

@AaronGlenn10 , Try measures like

 


Rank = Rankx (ALL(TABC[Location Name/City/Number]), [TABC Sales (CY)])

 

 

Location Rank in City = if(isfiltered(TABC[Location Rank in City]), [Rank], blank())

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

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.