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,
Im trying to create the "New Department" column where it looks for "Machine Shop" or "Charge Shop" in the Supplier column and returns those values if it contains one of those values. If it doesnt, it needs to return the value from the "Department" Column.
Can anyone please help?
Date | NCR | NCR TYPE | WO | PO | SUPPLIER | PART NUMBER | QUANTITY | DEPARTMENT | New Department | |
8/1/2024 | 1 | Internal | 101 | ABC 1 | 1 | Assembly | Assembly | |||
8/1/2024 | 2 | Internal | 102 | Machine Shop | ABC 2 | 3 | Assembly | Machine Shop | ||
8/10/2024 | 3 | Internal | 103 | Machine Shop | ABC 1 | 7 | Assembly | Machine Shop | ||
8/15/2024 | 4 | Supplier | P101 | Supplier X | ABC 5 | 4 | Receiving | Receiving | ||
8/15/2024 | 5 | Internal | 104 | ABC 2 | 8 | Assembly | Assembly | |||
8/15/2024 | 6 | Supplier | P102 | Supplier X | ABC 4 | 5 | Assembly | Assembly | ||
8/15/2024 | 7 | Supplier | P103 | Supplier X | ABC 2 | 3 | Receiving | Receiving | ||
8/20/2024 | 8 | Internal | 105 | ABC 3 | 6 | Assembly | Assembly | |||
8/25/2024 | 9 | Internal | 106 | ABC 3 | 2 | Assembly | Assembly | |||
8/30/2024 | 10 | Internal | 107 | Charge Shop | ABC 4 | 3 | Assembly | Charge Shop |
Solved! Go to Solution.
Please try this as a Calculated Column in DAX:
NewDepartment = SWITCH(
TRUE(),
[Supplier] IN { "Machine Shop", "Charge Shop" }, [Supplier],
[Department] )
Else you could do an if function in Power Query as well.
Regards,
Please try this as a Calculated Column in DAX:
NewDepartment = SWITCH(
TRUE(),
[Supplier] IN { "Machine Shop", "Charge Shop" }, [Supplier],
[Department] )
Else you could do an if function in Power Query as well.
Regards,
That worked! Thank you so much! I was way over thinking that for some reason.
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 |
---|---|
63 | |
63 | |
53 | |
39 | |
25 |
User | Count |
---|---|
85 | |
57 | |
45 | |
43 | |
38 |