Forum Discussion

russds's avatar
russds
Frequent Visitor
4 years ago
Solved

Not summing parent aggregations

I would like produce a measure that does not aggregate the child values, but only the parent.  Like this example: 

 

 

What I want is to get the value 68 (168-100) instead of 404 which is aggregating all the 168 values together. 

 

Note: Available Hours has summarization "Minimum" so that it doesn't sum the values, that's how I'm getting 168 for parent and child.  If there's a better way to achieve this, I'm happy to change it. 

 

Thanks in advance! 

 

  • Hi russds ,

     

    Please try the following formula:

     

    Measure = MIN('Sample'[Available Hours]) - SUM('Sample'[Allocated Hours])

     

    If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.

    Best Regards,
    Winniz

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

2 Replies

  • bcdobbs's avatar
    bcdobbs
    Icon for Community Champion rankCommunity Champion

    You'd need to count the number of projects in the filter context

    and use it to determine what level you are at. Something like:

     

    VAR ProjectCount = DISTINCTCOUNT(Table[ProjectId])


    RETURN

    IF (ProjectCount=1, [Availability], [Available]-[Allocated])

    Having reread your orignal post I think you're using implicit measures based on columns so you'd need to explicitly write a simple measure for Availability, Available and Allocated. If you want to send a demo file over I'll have a look.

     

  • v-kkf-msft's avatar
    v-kkf-msft
    Icon for Community Support rankCommunity Support

    Hi russds ,

     

    Please try the following formula:

     

    Measure = MIN('Sample'[Available Hours]) - SUM('Sample'[Allocated Hours])

     

    If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.

    Best Regards,
    Winniz

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