Forum Discussion
Excel data-source headings keep changing every month.
AndrewDavies437 yes it possible, add the following steps to rename the columns,
Old Column Name steps - gets the existing columns name of the table from the previous step
New Column Name steps - a list of column names you want to be, make sure these column names are in the correct order.
Rename column steps renames the old columns with the new columns.
With this solution it doesn't matter what is the column name in the excel file, as far as number of columns are the same, it should work.
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlTSUTI0MjAAUgpKsTrRSkZAlhFEwMJYFSxkDGRbgkV0TS2BQrEA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [CINESEMANA = _t, PÚBLICO = _t, #"VAR%" = _t]),
#"Old Column Names" = Table.ColumnNames(Source),
#"New Column Names" = { "Test1", "Test2", "Test3"},
#"Rename Columns" = Table.RenameColumns(Source,List.Zip({#"Old Column Names",#"New Column Names"}))
in
#"Rename Columns"
✨ Follow us on LinkedIn and to our YouTube channel
I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make effort to give Kudos to whoever helped to solve your problem. It is a token of appreciation!
Thank you for the reply!
I have tried another method that seems simpler, but would like to know if this is going to cause any issues because it seemed too easy.
I just deleted the "promoted headers" step and renamed my columns to what they'd want to be, then removed the first row (the headers).
Will this run into issues down the line?
If it does I will use your method but is there any reasons we aren't just doing it like this?
Thanks so much for your time.