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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

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