Power Query – Renaming Multiple Columns
I was working on a dataset where I wanted to change multiple column names using one step and not having to change them manually. Since there were over 30 columns this would be really time consuming.
Below I detail how to complete this in the Power Query Editor, which will replace all the column names for me in one step.
This once again shows how powerful the Power Query Editor can be for ETL and automation tasks!
-
This is what the Original Column names looked like
-
To get this working, I had to go into the Advanced Editor and manually add a step.
-
Here is the Syntax that I added with my Step Name
#”Rename Column Names” = Table.TransformColumnNames(#”Changed Type”, (columnName as text) as text => Text.Replace(columnName, “Sales – “, “”))
- As you can see above my previous step name was called #”Changed Type”
-
Then the only other change I had to make was for the Text.Replace and what I was searching for and what I wanted to replace it with.
-
With this example I was looking for “Sales – “, “”
- As you can see I searched for Sales – and replaced with “” (which is blank).
-
-
And this is what it looked like after manually adding in the above step.
As I have shown above a quick and easy way to rename multiple columns at once.
You can find the sample file here: Renaming Multiple Columns.pbix
As with every blog post if there are any comments or suggestions please leave them in the section below.
[…] a custom function to rename all columns at once? I recall I read an excellent blog post about renaming multiple columns in Power Query that Gilbert Quevauvilliers wrote in 2018. I definitely recommend looking at his blog post. So I […]
[…] perform to rename all columns without delay? I recall I learn a superb weblog submit about renaming a number of columns in Energy Question that Gilbert Quevauvilliers wrote in 2018. I positively advocate taking a look at his weblog […]
[…] todas as colunas de uma vez? Lembro-me de ter lido uma excelente postagem no blog sobre “Renomear várias colunas no Power Query” que Gilbert Quevauvilliers escreveu em 2018. Definitivamente, recomendo olhar sua […]
[…] perform to rename all columns without delay? I recall I learn a wonderful weblog put up about renaming a number of columns in Energy Question that Gilbert Quevauvilliers wrote in 2018. I undoubtedly suggest his weblog put up. So I need to do […]
[…] perform to rename all columns directly? I recall I learn a wonderful weblog publish about renaming a number of columns in Energy Question that Gilbert Quevauvilliers wrote in 2018. I undoubtedly suggest taking a look at his weblog […]
[…] nama semua kolom sekaligus? Saya ingat saya membaca posting weblog yang sangat bagus tentang mengganti nama beberapa kolom di Power Query itu Gilbert Quevauvilliers menulis pada tahun 2018. Saya sangat merekomendasikan untuk melihat […]
[…] operate to rename all columns directly? I recall I learn a wonderful weblog publish about renaming a number of columns in Energy Question that Gilbert Quevauvilliers wrote in 2018. I positively advocate his weblog publish. So I have to […]