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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
lilySixteen
Helper III
Helper III

show top 5 and bottom 5 data on the map chart

Hello,

 

I have a map chart that shows the year-over-year changes in % for cities from the 8th week of 2020 to the 23th week of 2020. Now, I want to filter out the top 5 cities and bottom 5 cities as I change the selected week.

 

For example, below is the map chart for cities. The green bubble indicates the city has positive change and red means negative change. The bubble size varies depending on the value (YoY change %). So, let's say, if Seatle/DC/Chicago/Dallas/NYC are the top 5 cities in terms of the value in week 8, I only want them to show on the map. 

 
 

Here is my City table. Btw, the data in the Value column is actually in %. Direction column only contains data 1 and 2:  1 means the value in the Value column is negative and will be a red bubble on the map, and 2 means positive and will be a green bubble on the map. The size column decides the bubble size. Week column calculates the week# . 

Annotation 2020-06-03 220934_1.png

 

Can anyone please help me with this? Thanks so much!

Lili

1 ACCEPTED SOLUTION

@lilySixteen , Try something like this. All measures

rankd = RANKX ( ALLSELECTED( 'City'[City] ), [YOY%], , asc,dense )
ranka = RANKX ( ALLSELECTED( 'City'[City] ), [YOY%], , asc,dense )

final Rank =CALCUALTE([YOY %], filter('City',rankd<=5 || ranka >= 5))

 

Also refer if you can use visual level filter

https://community.powerbi.com/t5/Community-Blog/Winner-Topper-on-Map-How-to-Color-States-on-a-Map-wi...

View solution in original post

4 REPLIES 4

@amitchandak thank you for your answer! I have tried RANKX but don't know how to apply it to the map. Can you please provide me details? Thasnks!

@lilySixteen , Try something like this. All measures

rankd = RANKX ( ALLSELECTED( 'City'[City] ), [YOY%], , asc,dense )
ranka = RANKX ( ALLSELECTED( 'City'[City] ), [YOY%], , asc,dense )

final Rank =CALCUALTE([YOY %], filter('City',rankd<=5 || ranka >= 5))

 

Also refer if you can use visual level filter

https://community.powerbi.com/t5/Community-Blog/Winner-Topper-on-Map-How-to-Color-States-on-a-Map-wi...

@amitchandak Thank you so much for your help. It answered my question. Very helpful!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.