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
Hello My Friends,
How Are you?
I really need some help
I have some Data like:
| Name | Date | Class | Value |
| A | 01/10/2015 | One | 100 |
| B | 01/10/2015 | Two | 100 |
| C | 03/10/2015 | One | 205 |
| D | 12/31/2015 | One | 320 |
| E | 08/10/2016 | Two | 130 |
| F | 09/11/2016 | Three | 30 |
| G | 09/12/2016 | Three | 60 |
| H | 10/20/2016 | Three | 90 |
And this Table Goes on with a lot of others rows.
I wanna Show inside a Card the "Class" wich presents the higher SUM of its VALUE's on a Card.
At the exemple above i would put a Card in my Dashboard and it would be written: "One" , Because "One" VALUE's Sum is Higher than "Two" VALUE's Sum or Three VALUE's Sums.
Does anyone knows how to Create a Measure to do this?
I Tried something like:
=MAXX( TOPN ( 1 ; DataSource ; DataSource[Value] ; Desc) ; DataSource[Class])
Solved! Go to Solution.
I would do something like this:
Measure =
VAR __Table =
SUMMARIZE(
'Table',
[Class],
"__Sum",SUM('Table'[Value])
)
VAR __Max = MAXX(__Table,[__Sum])
RETURN
MAXX(FILTER(__Table,[__Sum] = __Max),[Class])
[Best Class] =
var __bestClasses =
topn(1,
VALUES( T[Class] ),
CALCULATE( SUM( T[Value] ) ),
DESC
)
// You have to do this in case
// you have ties.
var __toString =
CONCATENATEX(
__bestClasses,
T[Class],
", ",
T[Class],
ASC
)
return
__toString
// If you don't want ties, then
// you can return the first or last
// class (alphabetically). Here's
// the version:
[Best Class] =
// Remove the one you don't want
MINX( // for the first class
MAXX( // for the last class
topn(1,
VALUES( T[Class] ),
CALCULATE( SUM( T[Value] ) ),
DESC
),
T[Class]
)
Best
D
I would do something like this:
Measure =
VAR __Table =
SUMMARIZE(
'Table',
[Class],
"__Sum",SUM('Table'[Value])
)
VAR __Max = MAXX(__Table,[__Sum])
RETURN
MAXX(FILTER(__Table,[__Sum] = __Max),[Class])
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!
| User | Count |
|---|---|
| 21 | |
| 10 | |
| 9 | |
| 4 | |
| 4 |
| User | Count |
|---|---|
| 35 | |
| 31 | |
| 19 | |
| 13 | |
| 10 |