Forum Discussion

Powerwoman's avatar
Powerwoman
Icon for Helper II rankHelper II
2 years ago
Solved

Split inventory count on purchase orders

Hello everbody, hope I will get some help here. What I need is to identify the latest purchase orders, that provided the inventory count. Sample data: Itemno Inventory Count 1900-S 500 ...
  • Powerwoman's avatar
    2 years ago

    Hi there,
    found a solution:

    I created a calculated column that deducts values from the inventory total.

    remainingPurchaseUnits =
    var _index = itemLedgerEntryPurchase[Index]
    var _remainingUnits =  CALCULATE(
        sum(itemLedgerEntryPurchase[amount])
        , ALLEXCEPT(itemLedgerEntryPurchase,itemLedgerEntryPurchase[item])
        ,itemLedgerEntryPurchase[Index] <= _index
    )

    return
     [inventoryUnits]- _remainingUnits