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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

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 @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
Not applicable

Sadly no 😞 

Error: Bringing a lot of values when expecting only 1

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.