Forum Discussion
tranpeter
3 years agoNew Member
Dynamically rename column based on a mapping table
Hi, I currently have in my database a table that looks like this: We also have another table that provides the descriptive mapping for each generic column name. For example, CUST...
- Anonymous3 years ago
Hi tranpeter ,
You can refer the following links to rename column names dynamically:
Dynamically rename columns from a column names table
Table.RenameColumns( Source, List.Zip( {fOldColumnNames("TableName"), fNewColumnNames("TableName") } ) )Using M to dynamically change column names in PowerQuery
Dynamic Column Names in Power Query
Any comment or problem, please feel free to let me know.
Best Regards
tranpeter
3 years agoNew Member
A coworker pointed me to this solution. I'll have to give it a try and update this post on whether this worked.
Anonymous
3 years agoNot applicable
Hi tranpeter ,
You can refer the following links to rename column names dynamically:
Dynamically rename columns from a column names table
Table.RenameColumns(
Source,
List.Zip( {fOldColumnNames("TableName"), fNewColumnNames("TableName") } )
)
Using M to dynamically change column names in PowerQuery
Dynamic Column Names in Power Query
Any comment or problem, please feel free to let me know.
Best Regards