Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Anonymous
Not applicable

Edit/Replace in a DAX measure

Hello,

 

I've made some changes to my excel data for the sake of uniformity, but now I need to go and adjust my DAX measures to reflect those changes.

Is there a function in Power BI similar to the "Replace" function in excel (picture)  so I don't have to manually change every single occurance of this data in my measures?

 

Thanks in advance for your help!

 

Replace feature.jpg

 

1 ACCEPTED SOLUTION
DataInsights
Super User
Super User

@Anonymous,

 

You can achieve this with Tabular Editor (free utility). In the Advanced Scripting tab of Tabular Editor, run the following:

 

var FromString = "Group 6 MS 404";
var ToString = "Group 6 (MS 404)";

foreach (var m in Model.AllMeasures)
{
m.Expression = m.Expression.Replace(FromString,ToString);
}

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

4 REPLIES 4
DataInsights
Super User
Super User

@Anonymous,

 

You can achieve this with Tabular Editor (free utility). In the Advanced Scripting tab of Tabular Editor, run the following:

 

var FromString = "Group 6 MS 404";
var ToString = "Group 6 (MS 404)";

foreach (var m in Model.AllMeasures)
{
m.Expression = m.Expression.Replace(FromString,ToString);
}

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




I've been using this method for a while but suddenly it no longer works, any idea why? Using that exact template fails to replace the values in the expressions i've selected.

Anonymous
Not applicable

@DataInsights 

Thank you so much! But, where do I find tabular editor?

Thanks again!

https://github.com/TabularEditor/TabularEditor/releases/tag/2.16.6 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Top Solution Authors