Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

How to use Switch on different columns

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"...
  • Mariusz's avatar
    Mariusz
    7 years ago

    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.