Forum Discussion
Renaming columns and excel
- 1 year ago
I expect someone might find a better solution but this was the best we could get.
We used an excel file to copy and transpose paste the column names for each of the two tables. Then we added a third column where we added a new name that could be used on both files. Using vlookup we matched the columns from the files to the freshly name.
In Power Query in Power BI, we used the first row as the header and then had to rename all of the query steps in advanced editor. This wasn't too bad because we used a good structure for changes. We always suggest to suers that they create folders for data load, transformation and publish. The data load folder has all the initial connections to data. Then we reference queries and move to the transformation. Most of the time transformations are done as one long query, but sometimes we break them up into different steps (different steps here being referencing the query and adding more query steps) if this is easier to follow. All queries are removed from 'enable load' apart from the publish folder queries, which again are referenced from the transformation queries.
Hi,
If I understood correctly, you should be able to rename the new columns to the old names at the beggining of the query. This should let the Query run as it did previously.
Then rename them back to the new name in a new final step.
Otherwise you could see the full raw Query code (in PQuery, right-click the Query, click Advanced editor) and do a find replace of each time each column is mentioned (you can ask an AI do it quickly with your column mapping, or do it with a bit of programming outside PBI if you are familiar enough, but seems unnecesary).
Hope this helps!