Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Powerwoman
Helper II
Helper II

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

Powerwoman_0-1696952671870.png

Can this be done in Power BI?

1 ACCEPTED SOLUTION
Powerwoman
Helper II
Helper II

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

 

View solution in original post

2 REPLIES 2
Powerwoman
Helper II
Helper II

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

 

amitchandak
Super User
Super User

@Powerwoman , Do you have a date column? I think we need to build cumulative, but need date for that

 

Please share additional columns you have in table

 

Something like this

Power BI Inventory On Hand: https://youtu.be/nKbJ9Cpb-Aw

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors