Reputation: 2861
I have a simple calculation MyBase = SUM('MyData'[Amount])
and I would like to include an ifelse statement in Calculate
. The condition is IF [Currency Type] = "USD" THEN [MyBase]/2 Otherwise
print out the code below.
MyCalculate =
CALCULATE(
[MyBase],
KEEPFILTERS('MyData'[Currency] = "USD"),
KEEPFILTERS('MyData'[Scenario] = "AOP")
)
Upvotes: 1
Views: 152
Reputation: 30304
IF(
'MyData'[Currency] = "USD",
[MyBase]/2,
CALCULATE(
[MyBase],
KEEPFILTERS('MyData'[Currency] = "USD"),
KEEPFILTERS('MyData'[Scenario] = "AOP")
)
)
Upvotes: 1