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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
kjkreik
Frequent Visitor

Rolling Inventory

I have tried to get this to work and have searched all available resources to figure out how to transfer ending inventory to the next day's beginning inventory.  I have a table (Inventory) that is always "Today's" inventory.  I need to add production, subtract shipments to come up with ending inventroy for "Today", then roll today's ending to tomorrow's beginning etc. etc.  Easy in excel, thought it would be straightforward in PBI but for some reason I just havent been able to get it to work.  Help Please!

 

0-1706753962238.png

 

6 REPLIES 6
Ashish_Mathur
Super User
Super User

Hi,

I have solved a similar problem in the attached files.

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Any reason day 0 closing inventory wont transfer to day +1 opening inventory?  Days after +1 all work correctly.  I double checked all DAX to make sure it matches your example2 file.

 

 

Inventory.PNG

No idea.  If day 3 onwards are working fine, day 2 should work fine as well.  Recheck all the measures.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Here is your example2 file when I drop dim_date[cal_date].

 

Capture2.PNG

Everything works just fine on my file.  I do not know the mistake that you are committing.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
amitchandak
Super User
Super User

@kjkreik , Inventory need to be calculated in a cumulative manner

 

Beginning of Time(BOT) Inventory + Purchase till date from BOT - Sales till Date
Inventory / OnHand
[Intial Inventory] + CALCULATE(SUM(Table[Ordered]),filter(date,date[date] <=Min(date[date]))) -
CALCULATE(SUM(Table[Sold]),filter(all(date),date[date] <=Min(date[date])))


Inventory / OnHand
CALCULATE(firstnonblankvalue('Date'[Month]),sum(Table[Intial Inventory]),all('Date')) +
CALCULATE(SUM(Table[Ordered]),filter(all(date),date[date] <min(date[date]))) -
CALCULATE(SUM(Table[Sold]),filter(all(date),date[date] <min(date[date])))

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

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.