Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.
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
Country | Revenue | Company |
DE | 500 | A |
US | 400 | A |
GB | 300 | A |
FR | 200 | A |
ES | 100 | A |
US | 620 | B |
GB | 420 | B |
ES | 520 | B |
LV | 120 | B |
FR | 320 | B |
DE | 570 | C |
GB | 680 | C |
US | 215 | C |
ES | 350 | C |
FR | 485 | C |
Solved! Go to Solution.
@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)
Regards,
Charlie Liao
@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)
Regards,
Charlie Liao
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the September 2025 Power BI update to learn about new features.