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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

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

Hi @Anonymous 

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
v-cherch-msft
Employee
Employee

Hi @Anonymous 

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.
Anonymous
Not applicable

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?

 

 

Hi @Anonymous 

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.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.