Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi,
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,
You may refer to the following DAX.
Measure = SUMX ( TOPN ( 3, GROUPBY ( Table1, Table1[Country], "Revenue", SUMX ( CURRENTGROUP (), Table1[Revenue] ) ), [Revenue], DESC ), [Revenue] )
@Anonymous,
You may refer to the following DAX.
Measure = SUMX ( TOPN ( 3, GROUPBY ( Table1, Table1[Country], "Revenue", SUMX ( CURRENTGROUP (), Table1[Revenue] ) ), [Revenue], DESC ), [Revenue] )
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
109 | |
99 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
102 | |
87 | |
64 |