Showing results for 
Search instead for 
Did you mean: 
Regular Visitor


Hi All

I am trying to create a bump chart, ranking the countries by Value over years. I have the following calculations:


Top N CountriesValues =

VAR TopSelected = SELECTEDVALUE('Top N'[Top N])



TopSelected=0, [ONlyCountries Value],

RANKX(ALLSELECTED('Only Countries'[Country]), [ONlyCountries Value])<=TopSelected, [ONlyCountries Value])



RANK = RANKX(ALLSELECTED('Only Countries'[Country]),'Only Countries'[Top N CountriesValues])*-1


the reason why I need to calculate Top N CountriesValues is that I have a slicer Top N, which is showing how many countries I want to see in the chart based on their value.

For the bump chart I use Line chart, put Year on X-axis, RANK on Y-axis and Country on Legend.

The problem is when I select any value in the TOP N slicer, the bump chart is filtered ( showing selected N countries) BUT it is based on the laters year. for example I can see other countries during the years if they had the same rank as the TOP N selected countries. I think I am missing something in the RANK calculation...





Super User
Super User

@starry , Try TOPN with numeric Parameters


Power BI Tutorial Series for Beginners Part 42 TOPN:
TOPN with Numeric Parameter -

!! Microsoft Fabric !!
Microsoft Power BI Learning Resources, 2023 !!
Learn Power BI - Full Course with Dec-2022, with Window, Index, Offset, 100+ Topics !!
Did I answer your question? Mark my post as a solution! Appreciate your Kudos !! Proud to be a Super User! !!

unfortunately this video doesn't help

Helpful resources

May 2023 update

Power BI May 2023 Update

Find out more about the May 2023 update.

Submit your Data Story

Data Stories Gallery

Share your Data Story with the Community in the Data Stories Gallery.

Top Solution Authors