Forum Discussion
Anonymous
6 years agoNot applicable
Table Replace Value multiple condition
= Table.ReplaceValue(#"Expanded Code",each ([Geographical]="" or Text.Contains([Geographical],"INV")=true),"TBA",Replacer.ReplaceValue,{"Geographical"}) want to replace value to "TBA" if coulumn ...
- 6 years ago
Hi Anonymous ,
Let me know if I get you well but this option helps you with what you need?
https://drive.google.com/open?id=1LlxMa2ScsJpsf0ZcCJ31vo5a0kyvbIZT
Also there are other options like custom column and create a new column based on other column values but if you need to use the replace function in the same column that is how I would do it.
Any question, just let me know.
Regards,
Gian Carlo Poggi
Zubair_Muhammad
6 years agoCommunity Champion
Anonymous
With Table.ReplaceValue we can only replace one value at a time but you can specify multiple columns to make replacement in
https://docs.microsoft.com/en-us/powerquery-m/table-replacevalue
Alternatively, we can use a simple if statement
=Table.AddColumn(#"Expanded Code", "Custom", each if [Geographical]="" or Text.Contains([Geographical],"INV") then "TBA" else [Geographical])