Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi,
I am a beginner 🙂
I need to nest several switch.
Here is the idea (i am creating a new column) :
- If in column A there is the expression "Smart", then return "Idiot", if there is "Green", the return "Color", else return Column A. Up to here i can manage SWITCH(Column A;"Smart";"Idiot";"Green";"Color";"Column A")
- But here is the thing, I would like, in the same created column, to test the column B also.
Maybe you have a solution?
Solved! Go to Solution.
Hi @Anonymous,
Please see the below.
Column = SWITCH( TRUE, YourTable[Column A] = "Smart", "Idiot", YourTable[Column B] = "Tiger", "Animal", YourTable[Column B] )
Regards,
Mariusz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous
You Can use SWITCH with TRUE as a first argument like below.
Column = SWITCH( TRUE, YourTable[Column A] = "x" && YourTable[Column B] = "y", "x AND y", YourTable[Column A] = "x" || YourTable[Column B] = "y", "x OR y", "otherwise W" )
Regards,
Mariusz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Mariusz ,
thank you for your answer, but maybe I wasn't clear enough.
In the new column, I need evaluate several expression at once and return different results depending on the value.
So, if in column A there is the value "Smart", then return "Idiot" or if in Column B there is the value "Tiger", then return "Animal". Else, column B.
Or maybe I didn't understand your answer 🙂
Thank you in advance !
Hi @Anonymous,
Please see the below.
Column = SWITCH( TRUE, YourTable[Column A] = "Smart", "Idiot", YourTable[Column B] = "Tiger", "Animal", YourTable[Column B] )
Regards,
Mariusz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thank you !!
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
107 | |
93 | |
77 | |
65 | |
53 |
User | Count |
---|---|
147 | |
106 | |
104 | |
87 | |
61 |