Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
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 replace values.
E.g in the table below I need to replace the Department from "-" to "Sales" but not for every value in the Name column. Instead, I want to be able to provide the table with the names concerned (e.g just for Leo and Ken).
Any help is highly appreciated 😊
Name Department
Josh | IT |
Nathan | Services |
Leo | _ |
Margaret | _ |
Ken | _ |
Denis | IT |
Flora | Services |
Sandra | Services |
Solved! Go to Solution.
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
Works like a charm. Thanks a lot 😊
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