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
Syndicate_Admin
Administrator
Administrator

How do I create a measure that shows the subtotal of another measure?

Let me illustrate:

Jose2212_0-1702906968803.png
In power BI I have a rather complex measure "Metric1", it is already calculated but I need to show the sum for each country and use it to be able to calculate the percentage that corresponds to each client.

How could I do that subtotal calculation on a measure in Power BI?



1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Syndicate_Admin 

You can create two neasures, one is total_pais, another is %

TOTAL_PAIS =
VAR a =
    SUMMARIZE (
        ALLSELECTED ( 'Table' ),
        [COD_PAIS],
        [COD_CLIENTE],
        "Measure", [measure1]
    )
RETURN
    SUMX ( FILTER ( a, [COD_PAIS] IN VALUES ( 'Table'[COD_PAIS] ) ), [Measure] )
%Client/Total_Pais =
DIVIDE ( [measure1], [TOTAL_PAIS] )

Best Regards!

Yolo Zhu

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

View solution in original post

3 REPLIES 3
Syndicate_Admin
Administrator
Administrator

In power BI I have a rather complex measure "MEASURE1", it is already calculated but I need to show the sum for each country and use it to be able to calculate the percentage that corresponds to each client.
The first three columns represent what I already have and the last two the expected result, if they were data from the table there would be no problem but as they are calculated measurements I can't find a solution to do it in a powerbi matrix

COD_PAISCOD_CLIENTEmeasure1TOTAL_PAIS%Client/Total_Pais
11157520%
12207526,67%
13407553,33%
24325855,17%
25265844,83%
361010100%

Anonymous
Not applicable

Hi @Syndicate_Admin 

You can create two neasures, one is total_pais, another is %

TOTAL_PAIS =
VAR a =
    SUMMARIZE (
        ALLSELECTED ( 'Table' ),
        [COD_PAIS],
        [COD_CLIENTE],
        "Measure", [measure1]
    )
RETURN
    SUMX ( FILTER ( a, [COD_PAIS] IN VALUES ( 'Table'[COD_PAIS] ) ), [Measure] )
%Client/Total_Pais =
DIVIDE ( [measure1], [TOTAL_PAIS] )

Best Regards!

Yolo Zhu

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

Ritaf1983
Super User
Super User

Hi @Syndicate_Admin 

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-...
Please show the expected outcome based on the sample data you provided.

https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors