

Renaming a column in Power BI is easy. All you need to do is double-click on a column name and edit it. If you do that, the only thing that changes, is the name of the column in your Power BI model. It doesn’t change your data source. The change happens in your Power BI model only.
For example, If in the database there’s a column called “NumberOfTickets”, you’re likely to rename it “Number Of Tickets” in Power BI, to make it more readable for your users.
But, what if you need to rename a column in the database or file from which you load the data into your Power BI model? Can you safely go ahead and change the name in your data source? usually things will break as a result. Ideally, if you can, try and avoid changing data sources. But sometimes it’s not up to you, so let’s talk about what needs to be done in these cases.
In this article I’ll talk about three common scenarios of renaming a column in the data source, and how to handle them without much hustle.
Scenario 1: The column is not in use in your report
In this scenario, you’ve loaded a table/view/file into the model, and the column you need to rename at source has never been used. It hasn’t been renamed in Power BI, hasn’t been displayed anywhere, and hasn’t been part of a DAX calculation.
In this case, you can go ahead and rename it at the source. The next time you refresh your model, the change will be reflected, and there’s nothing you need to do in Power BI. After the refresh, if you look at your table, you’ll just notice the name change.
Scenario 2: The column is in use, and the Power BI model uses the same name as the source
In this scenario, you are using the column that’s being renamed, but in your Power BI model, you’ve never renamed it. For example, the original column name is “Passengers”, and you’ve never renamed it. Now it’s being renamed at the data source to “NumberOfPasssengers”. In this case, after the column has been renamed at source, your Power BI refresh will be successful, but some visualisations will fail to load:

In addition, if the column you’ve renamed at the data source, is used by calculated measures (part of their DAX formula), these measures become invalid:

To solve that, you have two options. The easy one would be to rename, in your Power BI model, the renamed-at-source field, to its original name. In the example above, this means renaming “NumberOfPasssengers” back to “Passengers”. If you do that, all visualisations and DAX calculations will become valid again.
The other option is to go over all invalid visualisations and DAX calculations, and edit them to use the new field name.
Scenario 3: In use or not, you’ve already changed how the column is called in your model.
This is the trickiest scenario. Your model has already been changed to rename a column, say from “Passengers” to “Number Of Passengers”. Now, the data source is changing, and “Passengers” is being renamed to “NumberOfPasssengers”. The problem here, is that when you try to refresh your model, Power BI won’t play along, and let you know it couldn’t find the field “Passengers” in your data source. The reason is, you’ve already told Power BI to rename “Passengers” to “Number Of Passengers”, and it cannot do it for you, because there’s no “Passengers” field in your data source anymore.
If this is the case, you need to first remove the old rename step from your Power BI model. To do that, you need to go into query editor, right click on your table, and choose “Advanced Editor”:

A text editor sort of screen will then pop up, and you’ll need to find the old rename step, and remove it. It should be of this format: {“OldName”, “New Name“}. Just delete it.

Then, click on close&apply. A data refresh will succeed, now that you’ve removed the old rename step. If the field that’s being renamed at source is in use in the report, you’ll need to repeat the steps of scenario 2 as well.
I hope that helps. Please comment below if you have any questions.
3 Comments. Leave new
Is it possible to change column name of a table visual dynamically on basis on week or month…??
I don’t believe this is possible, no.
What I do when that’s needed, is I create different tables, and toggle between them using bookmarks and buttons.
This is too late for OP, but I think this guy https://www.youtube.com/watch?v=gJPA_Faotkk shows that possibility in Option 2, for anyone searching for this solution :).