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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Aurora-BI
Helper I
Helper I

How to calculate future inventory based on production rate and demand

Hi Everyone, 

 

Like the title says I am having some issues calculating future inventory levels (End Stock) for a part my company sells. 

AuroraBI_2-1713301055654.png

 

As of today, we have 724 units (QTYOH_06) and have a set value for how many units we produce in a week, 320. This value will eventually change, but we want to use a flat 320 for now. I have tried to filter my calculation so it will only subtract the quantities due of this specific part.

 

On Each "Ship Date", the related quantity will be subtracted from the total. I would like to put the results in a table, so I can show when in the future we will run into a negative inventory quantity for this part. The current measure I am trying to use is: 

End Stock =
    CALCULATE(
        SUM(Part_Stock[QTYOH_06]) + SUM('Weekly Quantities 2024'[Max Qty]) - CALCULATE(SUM('Combined Table'[Quantity]), 'Combined Table'[Part Number] = "171-CT1-1501"),
        Filter(
            ALL('Combined Table'),
            'Combined Table'[Ship Date] = MAX('Combined Table'[Ship Date])))

 

But this is not exactly achieving what I would like it to. I also have a table that shows how many units were built each day, I am not sure if this would be easier to use than the weekly totals.

AuroraBI_3-1713301386246.png

 

Does anyone know how I can fix this measure so I am able to calculate future inventory levels? Any help is greatly appreciated! 

 

2 REPLIES 2
DataNinja777
Super User
Super User

Hi @Aurora-BI 

 

Have you created the calendar table and Parts dimension tables in your data model?   You can built your required output by the following logic: 

Opening stock quantity + Production quantity - Scheduled shipping quantity = Closing stock quantity

You can create the cumulative sum of production quantity and shipping quantity during the period of opening and closing dates. I tried to convert your screen print sample data, but power query "From picture" didn't convert your picture above accurately, so I'd greatly appreciate it if you could paste your data in copy & pastable format for further demonstration.  

@DataNinja777 

 

Do you know how I can provide the data in a pasteable format? I tried to post an excel file with the data but it says the file type is not supported. I think there may be too much data to directly paste the data tables in the reply on here.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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