Forum Discussion
Anonymous
4 years agoNot applicable
Rename some columns by adding a prefix
Hi everyone. I have some tables with aprox. 40 columns. I would like to rename some of these columns by adding a prefix. I have tried Table.PrefixColumns but this adds a prefix to all the columns. I...
- 4 years ago
Thanks for the additional info.
See attached PBIX.
KNP
4 years agoSuper User
Probably, which columns?
Please provide sample data.
- Anonymous4 years agoNot applicable
Hi, basically I want to achieve this:
All columns but ITEM, get the prefix "CANT" in their name
- KNP4 years agoSuper User
Thanks for the additional info.
See attached PBIX.
- Anonymous4 years agoNot applicable
Thank you. It worked really good.
- ronrsnfld4 years agoSuper User
With that information, you can modify what I wrote by creating the list appropriately by changing two lines: (replace "tbl" with the appropriate table reference
#"Columns to Prefix" = List.RemoveMatchingItems(Table.ColumnNames(tbl),{"ITEM"}), Prefix = "CANT",