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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anonymous
Not applicable

Take the sum of a measure

Categorymeasure calculatedWhat i Want
CC1010/39
DC1212/39
MC99/39
VC88/39
Total391

Good morning All,

I created a simple measure , and i would like to divide each value  by the grand total for each category such that i can get the value in %.
exemple above(table).
How can i divide each line by the total .
I tried Calculate ( [measure calculated], filter'table','table'[category] ="CC") / [Measure calculated].
the formula is not working. 

Best regards,

AK

1 ACCEPTED SOLUTION
FreemanZ
Super User
Super User

hi @Anonymous 

Try like:

Pecent = DIVIDE([Measure Calculate], CALCULATE([Measure Calculated], ALL()))

View solution in original post

3 REPLIES 3
Mahesh0016
Super User
Super User

Mahesh0016_0-1671009145720.png

 @Anonymous 

TomasAndersson
Solution Sage
Solution Sage

Hi!

You have the right idea in your measure, but it's the other way around.

So the context in each row will automatically change to the current Category (CC, DC and so on), the measure will be calculated based on the Category in the current row, so your first FILTER() is not needed. However, you need to add a filter so that it calculates the Grand Total and not the sum of the measure in the current row context.

Try

What you want = 
DIVIDE(
    [Measure],
    CALCULATE(
        [Measure],ALLSELECTED('Table'[Category])
)
FreemanZ
Super User
Super User

hi @Anonymous 

Try like:

Pecent = DIVIDE([Measure Calculate], CALCULATE([Measure Calculated], ALL()))

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

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

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.