Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
What is the best way to create a conditional column in direct query with multiple conditions. I would like the condition to state the following.
If Original Column = A then T, else if Original Column = B then U, else if Original Column = C then V, else if Original Column = D then W. If none of the criteria is met then return Original Column.
See the table below for output
| Original Column | New Column |
| A | T |
| B | U |
| C | V |
| D | W |
| E | E |
| F | F |
| G | G |
| H | H |
| I | I |
Solved! Go to Solution.
Hi @dwhittaker1
In Power BI desktop, please create a calculated column and paste the below DAX (update the dax as per your requirement)
New Column = SWITCH(
TRUE(),
'Table'[Original Column] IN {"A"},"T",
'Table'[Original Column] IN {"B"},"U",
'Table'[Original Column] IN {"C"},"V",
'Table'[Original Column])
Let me know if that works for you
If your requirement is solved, please mark THIS ANSWER as SOLUTION ✔️ and help other users find the solution quickly. Please hit the Thumbs Up 👍 button if this comment helps you.
Thanks
Pijush
Linkedin
Proud to be a Super User! | |
Hi @dwhittaker1
In Power BI desktop, please create a calculated column and paste the below DAX (update the dax as per your requirement)
New Column = SWITCH(
TRUE(),
'Table'[Original Column] IN {"A"},"T",
'Table'[Original Column] IN {"B"},"U",
'Table'[Original Column] IN {"C"},"V",
'Table'[Original Column])
Let me know if that works for you
If your requirement is solved, please mark THIS ANSWER as SOLUTION ✔️ and help other users find the solution quickly. Please hit the Thumbs Up 👍 button if this comment helps you.
Thanks
Pijush
Linkedin
Proud to be a Super User! | |
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 40 | |
| 37 | |
| 33 | |
| 29 | |
| 27 |
| User | Count |
|---|---|
| 134 | |
| 104 | |
| 63 | |
| 60 | |
| 55 |