Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and a 50 percent discount on exams.
Get startedEarn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hi,
1. Based on my If condition, can I change the value of a different column?
For eg: if (pet = cat) then var1 = animal
2. In my If condition, I want to be able to write multiple statements both under "then" and "else".
Is this possible in PowerQuery or PowerBI and if not, what is the alternative?
For eg: if (pet=cat) then {var1=animal ; var2= mammal; } else { var1= noncat; var2="nonmammal"}
Thanks,
Jas
Solved! Go to Solution.
Hi @jasmine9 ,
Use "switch" function for each var,see below link:
https://docs.microsoft.com/en-us/dax/switch-function-dax
You may take below example for instance:
Measure for var1=Switch(
True(),
MAX([Pet])="cat","animal",
"noncat")
Best Regards,
Kelly
Did I answer your question? Mark my post as a solution!
Hi @jasmine9 ,
Use "switch" function for each var,see below link:
https://docs.microsoft.com/en-us/dax/switch-function-dax
You may take below example for instance:
Measure for var1=Switch(
True(),
MAX([Pet])="cat","animal",
"noncat")
Best Regards,
Kelly
Did I answer your question? Mark my post as a solution!
Hi,
You cannot do it al in one formula. You will have ot use 2 formulas - one each for var1 and var2.