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!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi there,
I have a measure that (1) creates a table, and (2) returns the max value for that table. It looks something like this:
measure = maxx(summarize('Table1','Table1'[Area],"Sales",[Sales]),[Sales])
If I understand how it works correctly what this does is
1. Summarize creates a table such as
| Area | Sales |
| North | 988 |
| East | 200 |
| West | 300 |
| South | 500 |
2. Maxx returns the max value for sales, that is, 988
What I want is a measure that returns "North" (the area with the max sales). I've been struggling a little but no luck, any help?
Cheers.
Solved! Go to Solution.
Give this a shot as well.
[Measure] is the measure you created which gets you maximum sales
Region with Max Sales =
VAR maxsales = [measure]
RETURN
CALCULATE (
FIRSTNONBLANK ( Table1[Area], 1 ),
FILTER ( ALL ( Table1[Area] ), [Sales] = maxsales )
)
Thanks to both!
I ended up using Zabair's solution, but probably both of them work, as from what I could gather they both use the same concept (filter the table for the value)
Zabairs one was pretty much a copy of mine. Not sure why he replied when I had already provided a more efficient solution that didn't require a calculate.
Hi @paa_paa
I think this measure gets close
Measure2 =
VAR myGrouping = SUMMARIZECOLUMNS('Table1'[Area],"Grouped Sales",SUM('Table1'[Sales]))
VAR myMaxValue = MAXX(myGrouping,[Grouped Sales])
RETURN
MAXX(
FILTER(
myGrouping,
[Grouped Sales] =myMaxValue) ,
[Area]
)
Give this a shot as well.
[Measure] is the measure you created which gets you maximum sales
Region with Max Sales =
VAR maxsales = [measure]
RETURN
CALCULATE (
FIRSTNONBLANK ( Table1[Area], 1 ),
FILTER ( ALL ( Table1[Area] ), [Sales] = maxsales )
)
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 38 | |
| 36 | |
| 33 | |
| 32 | |
| 29 |
| User | Count |
|---|---|
| 129 | |
| 88 | |
| 79 | |
| 68 | |
| 63 |