I wanted to know how to replace headers of the source data when changing the data source. In brief, I created a dashboard with the data source as an excel extract of a oracle database. Now, I've managed to create a live connection with the DB. The issue I'm facing is that although the table structure and data in it is same, the column headers in the excel file and the DB are different. I do not want to re-create the visuals using the new headers and simply want to replace the existing excel file with the DB connection and change the column headers names to that of the excel file so that visuals use the live data from the DB.
Original Column Headers
New Column Headers
% of Variable component
% of Fixed Component
In the table above the ORIGINAL COLUMN HEADERS are the fields which were in the excel file on which the dashboard visuals are based. The NEW COLUMN HEADERS are the fields in the DB. Now how can I change the data source to the DB and ensure that my visuals use the new column headers.
We can change the power queries in Advanced Editor as below, like changing the source and adding a rename action. The original data source is excel, and we can change it to SQL Server.
You can create a new PBIX file to get data from the db directly to see the generated power queries by Power BI. So that you can replace the power queries with above ones in the original PBIX file which get data from excel file.