Step 1 // Create a dimension table for Country Names based on Country/Region table and adding an Others field Country Names = UNION( ALLNOBLANKROW('_Country/Region'[Country/Region]), {"Others"} ) Step 2 // Create measure to use Total = MAX(Data[Value]) // Create measure to use that checks to see if Others is selected Total w'Others = // this gives the total of all values and removes the filter on country names VAR TotalOfAll = CALCULATE(SUMX(Data, [Total]), REMOVEFILTERS('Country Names'[Country/Region])) RETURN IF( ISINSCOPE('Country Names'[Country/Region]), -- checks to see if individual country picked VAR CountrysToRank = [TopN Value] -- creates a variable to see how many countries picked VAR IsOtherSelected = SELECTEDVALUE('Country Names'[Country/Region]) = "Others" VAR CountriesWithValues = -- creates a table of all countries with amount of cases ADDCOLUMNS( ALLSELECTED('Country Names'[Country/Region]), "@Amt", [Total] ) VAR TopNCountries = TOPN( CountrysToRank, CountriesWithValues, [@Amt]) -- uses TopN to create a table of TopNCountries dependant upon number chosen in TopN Value VAR AmountOfTopN = SUMX(TopNCountries, [@Amt]) -- iterate over top N Table to create total amount of TopN Countries VAR Result = IF( IsOtherSelected, TotalOfAll - AmountOfTopN, [Total]) -- if other is selected, then return the total of all - sum of all topn selected RETURN Result, TotalOfAll ) // Total Confirmed Measure Total Confirmed = CALCULATE([Total w'Others], Data[Type] = "Confirmed") Step 3 Create Logic for selecting top n // Create TopN table TopN = GENERATESERIES(0, 200, 1) // TopN Value TopN Value = SELECTEDVALUE('TopN'[TopN]) // Ranking Table Ranking = VAR CountriesToRank = [TopN Value] -- number of countries to rank VAR Ranking = RANKX ( ALLSELECTED ( 'Country Names'[Country/Region] ), [Total Confirmed] ) -- iterate through and rank each country by total numbers VAR IsOtherSelected = SELECTEDVALUE ( 'Country Names'[Country/Region] ) = "Others" -- check to see if others selected VAR Result = IF ( -- if other selected plus one to ranking IsOtherSelected, CountriesToRank + 1, IF ( Ranking <= CountriesToRank, Ranking, Ranking + 1 ) -- if numbers being ranked is less than the countries to rank, give normal rank, else add 1 to enable others to be shown in filter ) RETURN Result // This iterates through and gives a boolean filter to enable filtering on the canvas RowVisible = VAR Ranking = [Ranking] + 1 VAR TopNValue = [TopN Value] + 1 VAR Result = INT(Ranking <= TopNValue + 1) RETURN Result I used https://www.sqlbi.com/articles/showing-the-top-5-products-and-others-row/ to help me understand and build the logic.