March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
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.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
129 | |
90 | |
75 | |
58 | |
53 |
User | Count |
---|---|
200 | |
104 | |
101 | |
67 | |
55 |