Forum Discussion
Rename dynamic column header when transforming data
I am trying to incorporate data in a column into my report. However the field name is "Current Week Updates (3 Jun - 7 Jun)", with the dates component manually updated on a weekly basis in the source data file (excel web).
Trying to find a way to prevent an error with the data every week when the field name is updated. Thought of adding a step to rename the column header automatically to a standardized name so that there won't be an error when I am pulling the data in the report. Is there a way to do this?
Right now this is what I have:
Of course, there is an error and I am stuck. Please provide suggestions for a solution based on your expertise.
Thanks in advance!
1 Reply
- amitchandakSuper User
Anonymous , Syntax in is not correct for rename columns
https://learn.microsoft.com/en-us/powerquery-m/table-renamecolumns
example
Table.RenameColumns(
Table.FromRecords({[CustomerNum = 1, Name = "Bob", PhoneNum = "123-4567"]}),
{
{"CustomerNum", "CustomerID"},
{"PhoneNum", "Phone"}
}
)