Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

Rename multiple column names along with split words

I have a table imported into Power Query editor. The columns have the following names:

accountid| accountcode| customersizecode| preferredcontact

--------------------------------------------------------------------

1234        | wdkdf           | abdef                     | dksdmsd

1092        | kjfgfkf           | hghg                      |opwkffkd

1342        | isivmw          | wlslvs                      | wyywcga

 I am trying to rename the columns with splited words to it's corresponding phrase. e.g. :
Account Id | Account Code | Customersize Code | Preferred Contact ....

 

I tried 

 Table.TransformColumnNames

 but it doesn't work.

 

Any idea on split the word?

Thanks!

@ImkeF

2 ACCEPTED SOLUTIONS
mahoneypat
Microsoft Employee
Microsoft Employee

Oops.  Over thought it.  You will need to hardcode it manually, I think.  Just double click on each column header and type in the desired column name.  This should result in a single step that renames multiple columns.

Regards,

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


View solution in original post

v-yingjl
Community Support
Community Support

Hi @Anonymous ,

Seems that you have not specific split definition for multiple columns like "_", " " etc. so the directly way to rename columns is that renaming them manually which is like @ mahoneypat mentioend.

If your columns have the same split defintion, you can follow this similar issue to rename them:

Rename multiple column names along with changing their column numbers to Letters 

 

Best Regards,
Community Support Team _ Yingjie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
v-yingjl
Community Support
Community Support

Hi @Anonymous ,

Seems that you have not specific split definition for multiple columns like "_", " " etc. so the directly way to rename columns is that renaming them manually which is like @ mahoneypat mentioend.

If your columns have the same split defintion, you can follow this similar issue to rename them:

Rename multiple column names along with changing their column numbers to Letters 

 

Best Regards,
Community Support Team _ Yingjie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

mahoneypat
Microsoft Employee
Microsoft Employee

Oops.  Over thought it.  You will need to hardcode it manually, I think.  Just double click on each column header and type in the desired column name.  This should result in a single step that renames multiple columns.

Regards,

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


mahoneypat
Microsoft Employee
Microsoft Employee

Not sure what your input data looks like.  Hopefully you could split your columns by "|" to avoid having to remove it.  If not, a step with this formula with will remove "|" from all column names.  You can rename one column to generate most of the code needed, and then copy/paste the List.Zip part over the same part of that.

 

= Table.RenameColumns(#"Changed Type", List.Zip({Table.ColumnNames(#"Changed Type"), List.Transform(Table.ColumnNames(#"Changed Type"), each Text.Replace(_, "|",""))}))

 

Regards,

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Anonymous
Not applicable

Thanks for the anwering!  "|" just mean different columns, LOL. What I really want is to rename multiple columns name from "accountid" to "Account ID", "accountcode" to "Account Code"...

The hard part is there is no delimiter to split the text. 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors