cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
heytherejem
Post Prodigy
Post Prodigy

Replace multiple words simultaneously in M Query

Hi there

 

I have a 'Comments' column and I want to remove about 70 words to clean it up. I am loath to use replace, because it creates 70 steps and takes ages. 

I have found Table.TransformColumnTypes combined with Text.Remove (see below syntax) but this only replaces single characters, not words. 

= Table.TransformColumns(PreviousStep,{{"Text Comments", each Text.Remove(_,{})}})

 

Is there a function I can apply to my table, or some other fancy way, within M Query (I know about word clouds) that I can do this?

 

Jemma 🙂 

 

 

1 ACCEPTED SOLUTION
5 REPLIES 5
negi007
Super User
Super User

@heytherejem will it be possible for you to share the input or output you are expecting from your data. Please share data in text format so that we can do the testing at our end and suggest a solution to you. 




Did I answer your question? Mark my post as a solution!
Appreciate your Kudos


Proud to be a Super User!

Follow me here


VijayP
Super User
Super User

@heytherejem can you share one or two examples




Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
MY Blog || My YouTube Channel || Connect with me on Linkedin || My Latest Data Story - Ageing Analysis

Proud to be a Super User!


VijayP
Super User
Super User

@heytherejem 

Try using add column from example and try to give few examples to train power query to remove respective words ! may be you need to give few examples 4 to 5. Let me know if you are able to do that!




Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
MY Blog || My YouTube Channel || Connect with me on Linkedin || My Latest Data Story - Ageing Analysis

Proud to be a Super User!


Sorry @VijayP no chance. The text is too detailed, example column gets instantly confused and tries to transform the whole sentence.

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

November Power BI Update 768x460.png

Check it Out!

Click here to read more about the November 2021 Updates!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.