Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
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
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!