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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Vistazo
Regular Visitor

How do I remove "sum of" or " "count of" from value names?

Hi. I am looking for a way to remove "sum of" or "count of" from the titles in my Values column. I just want to see the title. There are over 50 entries, so I don't want to use the "rename for this visual" option. If there is a measure I can create to apply a fix to all values, can s.o. please show me how? Thanks.

6 REPLIES 6
v-jianpeng-msft
Community Support
Community Support

Thank you @Ashish_Mathur and @samratpbi 

Hi, @Vistazo 

Bulk renaming of columns can currently be done with the help of external tools, in the example below I have a number of sum of xxx measures/columns, which we can do in bulk via the tabular editor:
Power BI :

vjianpengmsft_0-1721626733178.png

The C# script is as follows:

foreach (var measure in Model.AllMeasures)
{
    if (measure.Name.StartsWith("sum of ", StringComparison.OrdinalIgnoreCase))
    {
        measure.Name = measure.Name.Substring(7); // Remove the "sum of " prefix
    }
}

vjianpengmsft_1-1721626781583.png

When we run the script, all columns containing sum of are removed:

vjianpengmsft_2-1721626817677.png

Save your changes to view them in Power BI desktop:

vjianpengmsft_3-1721626858123.png

This method is suitable for bulk renaming. In your image, if it's the sum of ....prefix that results from the automatic aggregation of fields in a visual, and those prefixes are only valid in the visual, then we might have to modify the configuration file at the bottom of Power BI desktop if we want to change it. In fact, I don't recommend this workaround. If you modify the underlying files, it will affect the normal operation of your Power BI Desktop software, and we need to change all the configuration files that rely on this automatic aggregation feature, although it can achieve the purpose, but it takes much more effort than directly modifying the visual name and Power BI Service will not apply the current changes, because Power BI Service is a cloud service and we don't support modifying its configuration files.
At the moment, the method you have the option to do is: name them manually.
If you have the same column as I showed above, then you can use the method I provided above.

 

 

Best Regards

Jianpeng Li

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

samratpbi
Super User
Super User

Hi, In the Build section, where you added your column, simply double click on the name and rename it to whatever name you want to have.

samratpbi_0-1721341432886.png

 

If this helps to resolve your problem, then please mark this as solution, Thanks!

Thanks but I don't understand. Here is my use case. I would like to remove the words "sum of" from EVERY VALUE, to leave only the value title. In this case, the month. I don't want to use the "rename for this visual" option as it takes too long. 

Values.jpg

Hi,

Furthermore, i see a problem with the layout/structure of your data.  You have a column for a month.  Instead all months should appear in a single column.  Please read up on/Google for "Unpivot Other Columns" in Power Query.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Hi,

If you use Sum or any aggregation, it will appear as the same until you rename the name. You may create measure with desired names.

Thanks

Thanks. I am new to Power BI. Can you tell me exactly what are the steps to create a measure to remove the words "sum of" from the entries in the values column. 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.