Forum Discussion
Replicate Dax SWITCH code in Query editor
- 5 years ago
Hi Pandadev ,
Your closing brackets are wrong.
IF ([Event Code]="Q3" AND [MarketSector]="Commercial") THEN "AW"
ELSE IF ([Researcher]<>"SLR" AND [OperatorTypeCode]="16") THEN "SLR"There is a nice example on the following blog:
https://www.fourmoo.com/2018/11/27/multiple-conditions-for-a-conditional-column-in-power-query/Thanks,
Pragati
Hi Pandadev ,
It will be a simple IF AND ELSE condition. Something like below: (you can find many examples online)
IF([Event Code]="Q3" AND [MarketSector]="Commercial") THEN "AW" ELSE IF ......
Thanks,
Pragati
I tried this but it shows an error on first AND , token comma expected
IF(
[Event Code]="Q3" AND [MarketSector]="Commercial") THEN "AW"
ELSE IF
[Researcher]<>"SLR" AND [OperatorTypeCode]="16") THEN "SLR" ))
- Pragati115 years agoSuper User
Hi Pandadev ,
Your closing brackets are wrong.
IF ([Event Code]="Q3" AND [MarketSector]="Commercial") THEN "AW"
ELSE IF ([Researcher]<>"SLR" AND [OperatorTypeCode]="16") THEN "SLR"There is a nice example on the following blog:
https://www.fourmoo.com/2018/11/27/multiple-conditions-for-a-conditional-column-in-power-query/Thanks,
Pragati
- Pandadev5 years agoPost Prodigy
Thanks for the example , I have now managed to get it to work