Forum Discussion

Syndicate_Admin's avatar
Syndicate_Admin
Icon for Administrator rankAdministrator
2 years ago
Solved

Replace values for certain items in another column

Hello,   I want to replace some of the values of one column when it matches values from another query (table). I know I can use merge queries and conditional columns, but I do not want to use repla...
  • slorin's avatar
    2 years ago

    Hi

    With Exception = {"Ken", "Leo"}

    = Table.ReplaceValue(
    Source,
    each [Name],
    each [Department],
    (row,name,dep)=> if List.Contains(Exception,name) and dep="_" then "Sales" else dep,
    {"Department"}
    )

    Stéphane