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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

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
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors