Press "Enter" to skip to content

Renaming a Power Query Column Based on Position

Ed Hansberry shows how to deal with renaming columns whose names regularly change:

The easiest way to rename a column in Power Query is to do it the same way you do in Excel – just double-click it and rename it. Sometimes though the column you are renaming can have different names with each refresh, so this method won’t work. We can use a List in Power Query to make this dynamic. Consider this very simple example:

You receive this file every day, and the column name starting in Row 6, Column B, constantly changes. We are going to extract that date and make it a column, as it should be, and then rename both columns regardless of what they are called.

Read on for the process.