Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hello,
I have a lot of measures that I would like to rename - specifically I would like to remove a prefix from all of them, let's say it's "KL - "
When I searched the community forums I only found this post:
https://community.powerbi.com/t5/Desktop/Bulk-renaming-of-measures/m-p/2641895#M927776
But I am not familiar enough with Tabular Editor to know what exactly to do.
Can someone drop some Tabular Editor code in this post that would allow me to do that? My TE version is 2.16.1.
Thanks in advance!
Never mind, found it! Posting here for others. Unfortunately, this works, but it breaks all visuals where the renamed measures are used 😞
var FromString = "TEXT TO REPLACE";
var ToString = "REPLACEMENT TEXT";
foreach (var m in Selected.Measures)
{
m.Name = m.Name.Replace(FromString,ToString);
}
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
107 | |
93 | |
77 | |
65 | |
53 |
User | Count |
---|---|
147 | |
106 | |
104 | |
87 | |
61 |