Forum Discussion

vpsoini's avatar
vpsoini
Helper I
4 years ago
Solved

Running total from multiple sources , starting from ground value?

Hello, and happy 2022!    My goal is to get inventory forecast, so I'm trying to calculate running total from multiple sources (sales and purchases) , but not really nailing it...  sales and purcha...
  • v-angzheng-msft's avatar
    v-angzheng-msft
    4 years ago

    Hi, vpsoini 

    ItemNo 2 should have a remaining amount of 19 on January 12.

     

    Try to create a measure like this:

    Measure = 
    SUM(Items[Inventory])+
    CALCULATE(
        SUM(ItemLedger[Qty]),
        FILTER(ALL(ItemLedger),'ItemLedger'[ItemNo]=MAX('Items'[ItemNo])&&'ItemLedger'[Date]<=MAX('ItemLedger'[Date])))

    Result:

    Please refer to the attachment below for details. Hope this helps.

     

     

    Best Regards,
    Community Support Team _ Zeon Zheng

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