# how to sum on one argument + common value • ### Question

• how to calculate in DAX Total_Val_E and Total_Val_A  ?
many thanks!

Total_Val_E= Value + Val_E
Total_Val_A= Value + Val_A

 Customer Value Val_E Val_A Total_Val_E Total_Val_A E 10 11 0 21 A 15 0 12 27 Grand Total 25 11 12 21 27

Friday, September 23, 2016 3:28 PM

• Using calculated columns is not very effective here (and should be avoided in general).

As I understand, the main difficulty is that you want to show nothing when Val_E or Val_A are zero, right?

You can easily accomplish this by testing on this condition:

Total_Val_A := IF([Val_A]>0, [Value]+[Val_A]

(Here I assume that Value and Val_A are measures)

Saturday, September 24, 2016 3:46 AM

### All replies

• Hello, Olaf Helper

[ Blog] [ Xing] [ MVP]

Friday, September 23, 2016 4:28 PM
• Using calculated columns is not very effective here (and should be avoided in general).

As I understand, the main difficulty is that you want to show nothing when Val_E or Val_A are zero, right?

You can easily accomplish this by testing on this condition:

Total_Val_A := IF([Val_A]>0, [Value]+[Val_A]

(Here I assume that Value and Val_A are measures)

Saturday, September 24, 2016 3:46 AM