top of page
9d657493-a904-48e4-b46b-e08acb544ddf.png

POSTS

Power Query: Clean All Text Columns in the Same Query

Writer: MirVel
MirVel
Apr 20, 2025
1 min read

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 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 =)






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

Rated 0 out of 5 stars.
No ratings yet

Add a rating
Excelized logo

Turn Messy Data into Clear Dashboards and Better Decisions.

Explore

Contact

Address:
83022 Rosenheim, Germany

Join Our Newsletter

Get a free Power Query cheat sheet by subscribing!

© Excelized. All rights reserved.

bottom of page