Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago

Top n with multiple columns

Hello,

 

I have been searching for the solution but cant been able to complete it.

 

I have 1 table (X) which has columns Costs (and has cost A,B,C,D,E), Country, Year,  YearMonth, Quarter, Brand and Value (which has the values).

Then i have a dashboard that has 2 selectors (Brand - Costs) and 4 tables (Ranking by country/year - Ranking by country/brand/year - Ranking by country/brand/month- Ranking by country/brand/quarter.

 

The issue come up when i want to only show top 3 in each table, lets say create a rank where i need to show top 3 countries that has biggests cost A (selected in selector) and in there top 3 years in each brand, below you can find an example in excel, basically replicate it.

 

Selected cost A and below rank:

 

Hope someone can help me.

 

Thanks in advance!

2 Replies

  • Hi Anonymous , i think the below solution will work for you. 

     

    1. Create a calculated meaure .

     

    TOPN( 3,

        VALUES( table1[Country] ),

        CALCULATE( SUM(table1[Values] ) )

    )

     

    Regards,

    Nikhil Chenna

     

    Appreciate with a Kudos!! (Click the Thumbs Up Button)
    Did I answer your question? Mark my post as a solution!

    • Anonymous's avatar
      Anonymous
      Not applicable

      Sadly no 😞 

      Error: Bringing a lot of values when expecting only 1