Forum Discussion

Mk60's avatar
Mk60
Resolver I
2 years ago
Solved

How to replace nested IF calculation for New Column with using switch

This nested if calculation DOES work fine, but I have hard time replacing this using SWITC function? I amm affraid that if I have much longer nested calc it might be safer to use switch instead. Can ...
  • MattAllington's avatar
    2 years ago

    I believe this would be better done in Power Query using conditional columns. To answer your question, you could use switch/true

     

    =SWITCH(TRUE(),

    Query1[PRODUCT]="20","Prod1",

    Query1[PRODUCT]="CC-20b","Prod2",

    etc

     

     

    also, use daxformatter.com to make it easier to read.