Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi guys,
I am new to Power BI, and come across this situation that I need to create a new column based on conditions of the other 4 columns. I've pasted screenshot of what the columns like down below with my further exaplanaiton.
As you can see 4 columns here and I marked then with different colours and with numbers as well.
Here is the condition from SQL server.
Bascially, I need to generate a new column (column 5) based on the conditions show in SQL. The conditions in SQL is saying if column 4 cell equals to SCA, then the new column 5 cell should use the value from column 1, and if the column 4 cell equals to OYU, then the new column 5 cell should use the value from column 3, and if the column 4 cell equals to neither SCA nor OYU, then use the the calue from column 2 for the new column 5. And after done all of that, column 1, 2 and 3 needs to be invisible.
So I was wondering if I can do this on Power BI?
Thanks in advanced.
Solved! Go to Solution.
@catpoisoncat , You can use Switch to create new column
column 5 = Switch(True() ,
[Column4] = "SCA", [Column1]
[Column4] ="OYU",[Column3],
[Column 2])
Switch-Case statement of #PowerBI: https://www.youtube.com/watch?v=gelJWktlR80&list=PLPaNVDMhUXGaaqV92SBD5X2hk3TMNlHhb&index=56
@catpoisoncat , You can use Switch to create new column
column 5 = Switch(True() ,
[Column4] = "SCA", [Column1]
[Column4] ="OYU",[Column3],
[Column 2])
Switch-Case statement of #PowerBI: https://www.youtube.com/watch?v=gelJWktlR80&list=PLPaNVDMhUXGaaqV92SBD5X2hk3TMNlHhb&index=56
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
19 | |
7 | |
6 | |
5 | |
5 |
User | Count |
---|---|
25 | |
10 | |
10 | |
9 | |
6 |