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

View all the Fabric Data Days sessions on demand. View schedule

Reply
MahmoudElgendi
Frequent Visitor

Calculate the Inventory OnHand Qty (FIFO) is remaining from which purchase transaction

Dears,
I’ve Purchases transactions for Items, and also sales transactions.

The requirements: assumes that the OnHand Qty as of Today is 748 Pcs,
I want a way to know from which purchase transactions these qty came from, assuming that FIFO is the inventory method (First In First Out)

In Excel, I used Offset and some other formulas

The result should be like that:

 

1.png

 

And the clean version keeps only the lines with Qty OnHand like that:

 

2.png
 

Then, I will create Aging for these Qty as I need to know how long this item is idle in the warehouse.

I want to achieve the same with DAX, I am attaching the Excel file.

I wish if someone can help me with this data and not to refer to other forum posts, as the Aging pattern will not work correctly until we do the same in the screenshot.

 

I uploaded the Excel file here, I need the result using DAX in Power BI
link to the file: https://rb.gy/vwtgbd

 

1 REPLY 1
amitchandak
Super User
Super User

@MahmoudElgendi , refer if this approch can help

 

https://radacad.com/dax-inventory-or-stock-valuation-using-fifo

 

 

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
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.