Forum Discussion
EDIT QUERY bulk replace
- 7 years ago
Hi Anonymous,
Read this article https://www.thebiccountant.com/2016/05/22/multiple-replacements-in-power-bi-and-power-query/
Regards,
Ruslan
-------------------------------------------------------------------
Did I answer your question? Mark my post as a solution!
Hi, Andy.
A little late to the battle but I figured this could come handy to many people. Here is an article that can help you out:
https://www.syntelli.com/easy-guide-to-bulk-replace-values-in-power-bi-or-power-query
I am not sure what your exact scenario is but sounds like you could use the following M formula in the Query Editor:
Text.Combine( List.ReplaceMatchingItems(
Text.Split ([Name], ” “), { {“.”, “”} , {“/”, ” & “} , {“-” , “,” } }
))
If you want to manage the thing dynamically, you can have the {"old value", "new value"} section as a different data table in Power BI and make it a list, then reference that list in your formula.
I hope this helps!