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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
Anonymous
Not applicable

Sum of Top3 Values

Imagine we have a similar dataset: 

I would like to create a measure using DAX that shows the total revenue for Top 3 countries only, from all companies of course!

 

I would like to know whether is is possible to do it in one formula. So far I did it in a couple of steps, but the question is whether a formula is possible to create that automatically figures out top 3 countries and then displays the sum of all revenues from these.

 

Your help will be much appreciated

CountryRevenueCompany
DE500 A
US400 A
GB300 A
FR200 A
ES100 A
US620 B
GB420 B
ES520 B
LV120 B
FR320 B
DE570 C
GB680 C
US215 C
ES350 C
FR485 C
1 ACCEPTED SOLUTION
v-caliao-msft
Microsoft Employee
Microsoft Employee

@Anonymous,

 

Create a rank column in your data model, and then add this rank column to your visual filter.

Rank = RANKX(FILTER(Sales,Sales[Company]=EARLIER(Sales[Company])),Sales[Revenue],,DESC)

Capture.PNG

 

Regards,

Charlie Liao

 

View solution in original post

1 REPLY 1
v-caliao-msft
Microsoft Employee
Microsoft Employee

@Anonymous,

 

Create a rank column in your data model, and then add this rank column to your visual filter.

Rank = RANKX(FILTER(Sales,Sales[Company]=EARLIER(Sales[Company])),Sales[Revenue],,DESC)

Capture.PNG

 

Regards,

Charlie Liao

 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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.

Top Solution Authors
Top Kudoed Authors