Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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!
Solved! Go to Solution.
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
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
Hi @LiyaZhao ,
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.
Hi @LiyaZhao ,
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.
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
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
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
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
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.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
102 | |
53 | |
21 | |
12 | |
12 |