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:

ItemnoInventory Count
1900-S500
1936-S90

 

Purchase orders  
ItemnoUnits purchasedInventory units in PORemaining Units
1900-S200200300
1900-S200200100
1900-S2001000
1900-S2000
1900-S3000
1936-S131377
1936-S111166
1936-S9957
1936-S5552
1936-S90520
1936-S8000

 

Formula should be like:
First row:
If Inventory Count > Units purchased then Inventory units in PO (1) = Units purchased
Remaining Units (2) = Inventory count - Units purchased
All other rows should use the remaining units, not the inventory count as calculation
The goal is to filter on (1) to get all the POs with inventory values
This should be possible by item

Can this be done in Power BI?

  • 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

     

2 Replies

  • 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