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

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.

Reply
yellow_old_5
Helper II
Helper II

Total by 3 categories

Hi, i have a test table:

ID Nrb CountryScenarioShare
363331AustraliaActual1.00
363331ChinaActual1.00
363331DenmarkActual1.00
363331IndonesiaActual1.00
363331IndiaActual1.00
363331JapanActual1.00
363331CanadaActual1.00
363331FinlandActual1.00
363331NorwayActual1.00
363331SingaporeActual1.00
363331GermanyActual1.00
363331SpainActual1.00
Total   1.00

I want to have a total share group by those 3 colums like 12

1 ACCEPTED SOLUTION
v-shex-msft
Community Support
Community Support

Hi @yellow_old_5,

You can try to use the following measure formulas, I add a variable with summarize function to aggregate value based on categories and use the iterator function to apply these second aggregations to summary previous results.

formula =
VAR summary =
    SUMMARIZE (
        ALLSELECTED ( Table ),
        [ID Nrb],
        [Country],
        [Scenario],
        "_Share", [Share]
    )
RETURN
    SUMX ( summary, [_Share] )

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

4 REPLIES 4
v-shex-msft
Community Support
Community Support

Hi @yellow_old_5,

You can try to use the following measure formulas, I add a variable with summarize function to aggregate value based on categories and use the iterator function to apply these second aggregations to summary previous results.

formula =
VAR summary =
    SUMMARIZE (
        ALLSELECTED ( Table ),
        [ID Nrb],
        [Country],
        [Scenario],
        "_Share", [Share]
    )
RETURN
    SUMX ( summary, [_Share] )

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
ryan_mayu
Super User
Super User

@yellow_old_5 

is share column a measure?

if not, when you set share as sum, you should get 12

1.PNG





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

Proud to be a Super User!




Hi, I forgett mention that Share is a measure

@yellow_old_5 

maybe you can try this

measure = sumx('Table',[share])
 
1.PNG




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

Proud to be a Super User!




Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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