Forum Discussion
IF - Multiple conditions
- Anonymous6 years ago
PGAT
You create the column in Query Editor which is M formula. I would recommend you to create a column with DAX not M query. The dax formula is something like:Column = SWITCH(True(), [BKR TYPE]="KCD" && [JOB TYPE]="OB" && [MODE]="SEA",3, [BKR TYPE]="KCD" && [JOB TYPE]="OB" && [MODE]="AIR",1.5, [BKR TYPE]="KCD" && [JOB TYPE]="IB" && [MODE]="SEA",2, ... ... ...)
Paul Zheng _ Community Support Team
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thanks to the both of you. I didn't know the difference between DAX and M.
How do I create the column in DAX? It seems complicated.
Currently, I tried to add customs column in query editor, and then to work out my IF.
After you close or close&apply from the power query editor. Power bi Desktop is worked with DAX calculation.
Paul Zheng _ Community Support Team
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- PGAT6 years agoHelper III
hi Paul, thanks, I tried but when I try to chart it, I don't see any values come up. Where did I go wrong? I stopped short of writing more just to see if I am getting it right. Is DAX case sensitive?