Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

EDIT QUERY bulk replace

Hi everybody,

 

i have to replace a lot of values in the query and the function replace takes a lot of time since I have to enter manually both old and new value.

 

Is there a way I can just copy and and parte old and new values in a mask, and then Power BI replaces everything? 

 

See the file attached.

 

Thanks in advance.

 

Regards,

Andy

1 ACCEPTED SOLUTION
zoloturu
Memorable Member
Memorable Member

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!

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

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!

zoloturu
Memorable Member
Memorable Member

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!

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.