Power Query: Clean All Text Columns in the Same Query

Updated: Oct 3
Function: Would you like to clean multiple columns in a single operation? This custom step allows you to clean as many columns as needed. Remove extra spaces, remove non-printable/control characters, like line feeds (#(lf)), carriage returns (#(cr)), tabs, etc.

Power Query code that you will use in the Custom Column (or inline custom step). Just reference your previous step in "Source.." (best practice is to rename steps in applied steps window, like instead #"Replaced Value" you can write Repl1. Then you will have: Source = Repl1,
(Use let and in Inside Steps)

Need a code snippet? Free of charge =)
Reuse your Power Query work
Extend your text-cleaning workflow with reusable Power Query transformation patterns for Excel and Power BI.
Need help adapting this to your data? Discuss your project.





Comments