Forum Discussion
David01
5 years agoFrequent Visitor
Calculate a value unless a column has a specific value.
Hi I am trying to do a subtraction unless a column has a specific value in it. What Im trying to do is if the value of list = a then return valuea = 2 else do a subtraction valuea - valueb I ...
David01
5 years agoFrequent Visitor
I had figured it out as I retired for the night.
This is what I did
Measure =
var tab =ADDCOLUMNS('Mytable',"Result",
if('Mytable'[List] = "a",calculate(sum(Mytable[valuea]) ,'Mytable'[List] = "a")
, [Dev minus For]))
return
sumx(tab,[Result])
Note [Dev minus For] is a measure that simply does valuea - valueb on all rows that I had origanaly created and reused.
Thanks for your replys and help.