Forum Discussion

Krupture's avatar
Krupture
Frequent Visitor
3 years ago
Solved

Calculating the SUM based on another table

        Hi All,   I have the above tables and I would like to Calculate the sum of all back orders that can be filled where the IN SHIP stock can fill, per each x and y table.    I tr...
  • v-jianboli-msft's avatar
    3 years ago

    Hi Krupture ,

     

    Please try:

    Measure = 
    var _a = CALCULATE(SUM('X State Back Orders'[Back Orders]),FILTER(ALL('X State Back Orders'),[State]=MAX('IN SHIP'[State])&&[Title]=MAX('IN SHIP'[Title])))
    var _b = CALCULATE(SUM('Y State Back Orders'[Back Orders]),FILTER(ALL('Y State Back Orders'),[State]=MAX('IN SHIP'[State])&&[Title]=MAX('IN SHIP'[Title])))
    return _a+_b

    Final output:

    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.