SOLVED

DAX with SUM and MAX

Iron Contributor

Hello,

 

I've got a Pivot Table constructed like this

 

 

kheldar_0-1640834564783.png

 

How can I get max of summed values of that field?

 

I've tried this but it fails.

 

=MAXX(SUMMARIZE(Table31,[Output]))

 

3 Replies
best response confirmed by kheldar (Iron Contributor)
Solution

@kheldar 

Let take such sample

image.png

You may create measures

V, sum:=CALCULATE( SUM(Table1[V] ), ALLEXCEPT(Table1, Table1[A], Table1[B] ) )

V, max Sum:=MAXX( ALLEXCEPT(Table1, Table1[A] ), [V, sum] )

Max of Sum:=IF( HASONEVALUE(Table1[B]), [V, sum], [V, max Sum] )

and use the latest one in PivotTable.

@Sergei Baklan 

 

Thank you for your response. You are everywhere and helping everyone out. I see your name often in almost every thread. I really appreciate it.

 

Okay, I managed to get the formulas working without errors. However,

 

The max value doesn't display next to the group.

 

 

 

 

 

 

Max of Sum: =IF( HASONEVALUE(Table31[Name]), [V, sum], [V, max Sum] )
V, max sum: =MAXX( ALLEXCEPT(Table31, Table31[Group] ), [V, sum] )
V, sum: =CALCULATE( SUM(Table31[Output] ), ALLEXCEPT(Table31, Table31[Group], Table31[Name] ) )



A is GROUP
B is Name
V is Output

 

 

 

 

 

 
 

 

kheldar_0-1640893037998.png

 
kheldar_10-1640893306778.png

 

However,

 

I don't need to display it in the pivot. I used cubevalue function which I learnt from you and it retrieved the data I wanted. Thanks a lot!!!

 

 

@kheldar 

Thank you. I'm not alone people, lot of clever people who are quite active with answers.

As for the PivotTable perhaps you shifted off subtotals for groups

image.png

1 best response

Accepted Solutions
best response confirmed by kheldar (Iron Contributor)
Solution

@kheldar 

Let take such sample

image.png

You may create measures

V, sum:=CALCULATE( SUM(Table1[V] ), ALLEXCEPT(Table1, Table1[A], Table1[B] ) )

V, max Sum:=MAXX( ALLEXCEPT(Table1, Table1[A] ), [V, sum] )

Max of Sum:=IF( HASONEVALUE(Table1[B]), [V, sum], [V, max Sum] )

and use the latest one in PivotTable.

View solution in original post