Forum Discussion
sum column A based on values in column B
Last column (3.754.621) should only total up values if column before (3.400.580) contains values (so the last 3 rows should not be part of the total, currently they are). Both data fields are within the same table.
If you have suggestions, they are more than welcome.
Thx, Michael
WeihsMichael you can write a measure like this
_val2 = CALCULATE(SUM(t2[val2]),FILTER(t2,t2[val1]<>BLANK()))
17 Replies
- smpa01
Community Champion
WeihsMichael you can write a measure like this
_val2 = CALCULATE(SUM(t2[val2]),FILTER(t2,t2[val1]<>BLANK()))- WeihsMichaelNew Member
Thanks, tried but get a syntax error.
- smpa01
Community Champion
WeihsMichael that is because you did not close parenthesis after
SUM(tbl[column]
- Samarth_18
Community Champion
Hi WeihsMichael ,
You can create a new column with below code and use it instead:-
column = if(column B <> blank(),column A)Thanks,
Samarth
- WeihsMichaelNew Member
Hi Samarth, thanks for posting the DAX line, it almost worked except for the total remaining unchanged. Maybe you have a clue?
Column C = IF('ZV Vertrieb'[Aboumsatz] <> BLANK(),'ZV Vertrieb'[Aboumsatz VJ],'ZV Vertrieb'[Aboumsatz])- Samarth_18
Community Champion
WeihsMichael , Based on the condition which you have mentioned. Below code would be ideal:-
Column C = IF('ZV Vertrieb'[Aboumsatz] <> BLANK(),'ZV Vertrieb'[Aboumsatz VJ])