cancel
Showing results for
Did you mean:
AndreR_DD 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])` 1 ACCEPTED SOLUTION

Accepted Solutions v-cherch-msft
Microsoft

## Re: Sum of single values from Max of two columns

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])` 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.
3 REPLIES 3 v-cherch-msft
Microsoft

## Re: Sum of single values from Max of two columns

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

## 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: `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? v-cherch-msft
Microsoft

## Re: Sum of single values from Max of two columns

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

Announcements #### 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

Make sure you didn't miss any of the things that happened in the community in January! Top Solution Authors
Top Kudoed Authors
Users online (2,305)