Forum Discussion
Nested iF in Dax
- 1 year ago
Hello JaweedL ,
You can use Switch Function to simplify your If code in DAX, please try the below code..
Result =
SWITCH (
TRUE(),
AND ( OR ( [Region] = "NewYork", [Region] = "Louisana" ), [salesAmount] > [Target] ), 0,
AND ( NOT ( OR ( [Region] = "NewYork", [Region] = "Louisana" ) ), [salesAmount] < [Target] ), 0,[value])If you find this helpful , please mark it as solution and Your Kudos/Likes are much appreciated!
Thank You
Dharmendar S
Hello JaweedL ,
You can use Switch Function to simplify your If code in DAX, please try the below code..
Result =
SWITCH (
TRUE(),
AND ( OR ( [Region] = "NewYork", [Region] = "Louisana" ), [salesAmount] > [Target] ), 0,
AND ( NOT ( OR ( [Region] = "NewYork", [Region] = "Louisana" ) ), [salesAmount] < [Target] ), 0,[value])
If you find this helpful , please mark it as solution and Your Kudos/Likes are much appreciated!
Thank You
Dharmendar S