Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
Anonymous
Not applicable

Max Value of the Sum of other Column

Hello My Friends,

 


How Are you?

 

I really need some help

 

I have some Data like:

 

 

NameDateClassValue
A01/10/2015One100
B01/10/2015Two100
C03/10/2015One205
D12/31/2015One320
E08/10/2016Two130
F09/11/2016Three30
G09/12/2016Three60
H10/20/2016Three90

 

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])

 

 

1 ACCEPTED SOLUTION
Greg_Deckler
Community Champion
Community Champion

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])


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

[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

Greg_Deckler
Community Champion
Community Champion

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])


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.