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.
I have data similar to the following:
Country | City | Location | Number |
USA | NY | A | 10 |
USA | LA | B | 65 |
USA | LA | C | 65 |
UK | London | D | 60 |
UK | London | E | 60 |
UK | Brighton | F | 60 |
Using this code I'm able to get to the MAXIMUM by Country or City:
VAR Exposure = MAXX(
DISTINCT('Table 1'[Country]),
CALCULATE(SUM('Table 1'[Number]))
)
RETURN
Exposure
Now I'd like to return the Country associated with [Exposure]
Thanks!
Solved! Go to Solution.
@mrothschild
Returns the country with the largest value:
Country Max =
var __t =
TOPN(1, ADDCOLUMNS(SUMMARIZE(table1,Table10[Country]),"@number", CALCULATE(SUM(table1[Number]))),[@number])
return
MAXX( __t, table1[Country])
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
@mrothschild
Returns the country with the largest value:
Country Max =
var __t =
TOPN(1, ADDCOLUMNS(SUMMARIZE(table1,Table10[Country]),"@number", CALCULATE(SUM(table1[Number]))),[@number])
return
MAXX( __t, table1[Country])
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
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 |
---|---|
113 | |
97 | |
80 | |
69 | |
59 |
User | Count |
---|---|
150 | |
119 | |
104 | |
87 | |
67 |