Batch Renaming Measures in Power BI Desktop

Batch Renaming Measures in Power BI Desktop

Adam Marshall

Picture this: you’ve built a semantic model for Sales with many well-written DAX measures. Then, your CEO decides that “Sales” should now be called “Revenue,” meaning you need to update all your measures. What’s the best way to handle this? In this post, I’ll explore several options, outlining the pros and cons of each.

My model

For illustration purposes, I’ve created a simple report with four different measures used in four visuals on a single page. In reality, you might have hundreds of measures, with potentially nested logic, spread across many pages.

Option 1: Manually Change Measures in Power BI Desktop

This is the simplest approach: manually updating the measure names within Power BI Desktop which can be time-consuming if you have many measures. The upside is that when you change a measure here, all visuals using it are automatically updated. But we need a better solution when we have many measures.

Option 2: Bulk rename in Tabular Editor

As you may know, Tabular Editor is the best tool out there to enhance productivity when editing semantic models. If I install Tabular Editor, I can Batch rename to replace the names of the measures I need to change.

This is great until I save this back to my report. Suddenly I’ve broken all my visuals!

Why? Because whilst we’ve edited the semantic model, the report doesn’t recognize that the fields have changed, causing a disconnect.

This approach is best if you have many measures to edit but haven’t fully built out your visuals yet. Keep in mind that you’ll lose any formatting you previously applied once you switch in your new measure names.

Option 3: Power BI Developer Mode (Preview)

In short, Power BI Developer mode is a code first approach to developing reports and semantic models. It’s more technical, but enables a developer to be much more efficient by allowing them to modify the underlying code for both the model and report directly. This allows us to address the disconnect we see when modifying the semantic model with Tabular Editor, as we can also edit the fields for each visual in the report.

To do this, you need to save the PBIX file as a Power BI Project (PBIP). This effectively splits the PBIX into several folders which contain the code for the entire semantic model and report.

I can open this folder with a code editor, such as Visual Studio Code, and then explore the code using the left navigation to drill down to my model and see the 4 measures.

Or I can drilldown into the report and see the code for each individual visuals. For example, I can see that one visual refers to “Total Sales1.”

Since the project is code-based, I can press CTRL+Shift+H to perform a search-and-replace across the entire semantic model and report.

If I replace all, then reopen the PBIP file in the folder everything has been updated!

This is a simple example of Power BI Developer Mode. I haven’t touched on more advanced features like source control and automation, but this shows the potential of working directly with the underlying code. Keep in mind, though, that if you edit the code incorrectly, you won’t be able to open the PBIP file. So, it’s your responsibility to ensure the code is correct!

You can continue working in the PBIP file or revert back to a standard PBIX file if you prefer.

Summary

There are various options for batch updating measure names in Power BI Desktop.

Manual updates work well if you have a few changes and don’t mind doing them individually, keeping the model and report in tact.

Tabular Editor is great for bulk renaming many measures, especially when you don’t have many visuals to keep in sync.

Power BI Developer Mode is the most powerful option, giving you direct access to both the semantic model and report code—but with great power comes greater complexity. It’s not for everyone, but it’s worth exploring if you have many changes to make.

Have I missed something? Is there a better way? Let me know in the comments.

en_USEnglish