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
what does [value]=0 mean?
maybe you can try something like below
If ( [Region] in { “NewYork”, “Louisana”} && salesAmount] >[Target] , XXXX , if ( NOT ([Region] in { “NewYork”, “Louisana”} ) && [salesAmount] < [Target], XXXX))
- JaweedL1 year agoHelper I
Hi ryan_mayu
Thank you. Works perfectly. Value was a meaure that I used for conditiinal formatting