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
chkapelis
Frequent Visitor

CALCULATE A PERCETANCE ON A SUBTOTAL

chkapelis_0-1673532242359.png

In the above image in column  2 want to calculate the % using the subtotal of the parental row 

 

for example the subtotal is 11 and i want to calculate (2-11)/11

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

Hi @chkapelis ,

 

According to your description, you want to calculate (2-11)/11 in the subtotal of the parent term, can you describe in detail what the 2 is based on? You have three values of 2,4,5 in the sub term, how is the 2 determined? If it is the minimum value, please try this:

Measure = 
var _a = SUM('Table'[Value])
var _b = CALCULATE(MIN('Table'[Value]),ALLEXCEPT('Table','Table'[ID]))
Return IF(ISINSCOPE('Table'[ID-2]),_a,DIVIDE((_b-_a),_a))

Final output:

vjianbolimsft_0-1673945508574.png

Best Regards,

Jianbo Li

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

2 REPLIES 2
v-jianboli-msft
Community Support
Community Support

Hi @chkapelis ,

 

According to your description, you want to calculate (2-11)/11 in the subtotal of the parent term, can you describe in detail what the 2 is based on? You have three values of 2,4,5 in the sub term, how is the 2 determined? If it is the minimum value, please try this:

Measure = 
var _a = SUM('Table'[Value])
var _b = CALCULATE(MIN('Table'[Value]),ALLEXCEPT('Table','Table'[ID]))
Return IF(ISINSCOPE('Table'[ID-2]),_a,DIVIDE((_b-_a),_a))

Final output:

vjianbolimsft_0-1673945508574.png

Best Regards,

Jianbo Li

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

 

sebouier
Frequent Visitor

Please try this:

Measure with subtotal =
    IF(HASONEVALUE('Your table'[KOKOPOY]),
        [Your measure],
        FORMAT([Your division],"+0\ %;-0\ %;+0\ %")
    )

 

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!

November Carousel

Fabric Community Update - November 2024

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

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.