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
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
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.

Top Solution Authors