top of page

Power Query: Clean All Text Columns in the Same Query

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 BI interface showing a custom column being added. Tables with Category_ID and Category_Name (Solvents, Polymers) are visible.
Custom Column in applied steps

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)

Screenshot of a code snippet in Power Query M language. It begins with "let" and includes variables for selecting and cleaning text columns.
Custom column step



Need a code snippet? Free of charge =)




Comments


© 2025 Excelized. All rights reserved.

bottom of page