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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
juanchiledesma
Frequent Visitor

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:

juanchiledesma_0-1669288751816.png

 

Hope someone can help me.

 

Thanks in advance!

2 REPLIES 2
NikhilChenna
Skilled Sharer
Skilled Sharer

Hi @juanchiledesma , 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!

Sadly no 😞 

Error: Bringing a lot of values when expecting only 1

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.