Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now
I'm looking for a solution to an issue i'm having with a client.
I have made them a power BI dashboard which works. Each month the client would like to update the datasource with a new excel file containing the same data as the previous excel file. However, quite often the column headers of the datasource change. This of course, causes issues with the dashboard when the new data source is uploaded.
For example:
"Total Income" changes to become "Total income (CT)"
or
"Commission Fee" changes to become "Commission Fee (AZ)".
Changes like this occur almost every month.
They do not have control of their datasource as it is exported from a third party software (which changes the column headers regularly).
This makes reporting quite difficult.
However, the order of the columns remains the same. I was hoping I could replace the column headers with A B C D E F G etc and then change them in a later step to work around this issue.
Is this possible in Power Query?
Any help would be greatly appreciated.
Thank you.
@AndrewDavies437 it should work fine as well.
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!
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
@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"
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!
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
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.
Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
User | Count |
---|---|
87 | |
87 | |
87 | |
67 | |
49 |
User | Count |
---|---|
135 | |
112 | |
100 | |
68 | |
67 |