Forum Discussion

S_Harmon's avatar
S_Harmon
New Member
2 years ago
Solved

Return value in column if it contains a specific value, if not return value in a different column

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 do...
  • rsbin's avatar
    2 years ago

    S_Harmon ,

    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,