0
votes

I have values that show up in my table according to a specified filter that i have applied such as,

Table 1 Sum | Table 2 Criteria 
-50 000       x
 40 000       y
-13 000       z
 10 000       v

if Criteria is either x, y or z I want to change the value of Sum from negative (-) to positive, if it is negative (-) or vice versa if value is postive. Value for V goes unchanged but still need to be added to the sum.

from above i want to transform the values to this and then sum them.

Table 1 Sum | Table 2 Criteria 
 50 000       x
-40 000       y
 13 000       z
 10 000       v

have not suceeded with anything that i have tried such as calculate(sum(filter etc and Switch true probably becuse im approaching this problem the wrong way...

Best regards /D

1

1 Answers

0
votes

You just need an if statement to change the sign for the values you want. For example,

Transformed = SUMX(Table1,
                  Table1[Sum] * IF(RELATED(Table2[Criteria]) IN {"x", "y", "z"}, -1, 1))

or

Transformed = SUMX(Table1, Table1[Sum] * IF(RELATED(Table2[Criteria]) = "v", 1, -1))

Switch sign