cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
AndreR_DD Frequent Visitor
Frequent Visitor

Sum of single values from Max of two columns

Hello,

I have a measure that calculates the max from two columns.
The sum of this measure should be the sum of the individual max values. Currently the sum is the max of the two comparative columns.

 

(In the example, the sum of the "PrognEndw VAR" column should be 202,361.25. - how can I get this sum?)

 

 

PrognEndw VAR = max(DIM_Budgetdaten[Bud+Prog. VAR];[MAX-IstSoll VAR])

 

incorrect sum2.JPG

1 ACCEPTED SOLUTION

Accepted Solutions
Microsoft v-cherch-msft
Microsoft

Re: Sum of single values from Max of two columns

Hi @AndreR_DD 

You may create a measure with VALUES function like below.

Max_value = MAX(SUM(Table1[Column1]),SUM(Table1[Column2]))
Total = SUMX(VALUES(Table1[Column3]),[Max_value])

1.png

Regards,

Community Support Team _ Cherie Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
Microsoft v-cherch-msft
Microsoft

Re: Sum of single values from Max of two columns

Hi @AndreR_DD 

You may try below measure:

Measure =
SUMX ( DIM_Budgetdaten; MAX ( DIM_Budgetdaten[Bud+Prog. VAR]; [MAX-IstSoll VAR] ) )

Regards,

Community Support Team _ Cherie Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
AndreR_DD Frequent Visitor
Frequent Visitor

Re: Sum of single values from Max of two columns

thank you for your answer. Now the sum is correct but the single values are wrong and I absolutely can´t comprehend where these values come from:

 

incorrect sum4.JPG

 

MAX IST-SOLL VAR = MAX ( SUM (FACT_Kalkulation[IST VAR]); SUM (FACT_Kalkulation[Soll VAR]) )
Progn.Endw. VAR = SUMX (FACT_Kalkulation; (MAX ( FACT_Kalkulation[Budget+Prog. VAR]; [MAX IST-SOLL VAR] )))

Progn.Endw. VAR in line 1 should be 184,476.991

 

I realized that if I manipulate and add (even a small) value (1) to IST VAR or SOLL VAR, Progn.Endw. changes a lot. Don´t know what is calculated 😞

 

Any ideas what is calculated and how the get the correct values?

 

 

Microsoft v-cherch-msft
Microsoft

Re: Sum of single values from Max of two columns

Hi @AndreR_DD 

You may create a measure with VALUES function like below.

Max_value = MAX(SUM(Table1[Column1]),SUM(Table1[Column2]))
Total = SUMX(VALUES(Table1[Column3]),[Max_value])

1.png

Regards,

Community Support Team _ Cherie Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Helpful resources

Announcements
Exclusive LIVE Community Event #3 – Ask Arun Anything

Exclusive LIVE Community Event #3 – Ask Arun Anything

Join us in the third Triple A event!

Meet the 2020 Season 1 Power BI Super Users!

Meet the 2020 Season 1 Power BI Super Users!

It’s the start of a new Super User season! Learn all about the new Super Users and brand-new tiered recognition system.

January 2020 Community Highlights

January 2020 Community Highlights

Make sure you didn't miss any of the things that happened in the community in January!

Top Solution Authors
Top Kudoed Authors