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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
JFR2022
Frequent Visitor

Calculate future cumulative stock with missing dates

Hi,

 

I want to calculate the cumulative stock per week based on the current stock and the planned consumption in the upcoming weeks and put it in a matrix.

The measure i'm using is:

 

cumulative stock = calculate([Current stock] - 'Planned'[Planned consumption],FILTER('Date','Date'[Date] >= today()))

 

Where "planned consumption" is a measure of the sum of the planned quantity in table "Planned".

In some of the weeks there are no orders planned so in my planned consumption table there are dates/weeks missing. 

I'm using a date table which is linked to the planned consumption tabel based on the planned date.

Example of values in table "Planned"

JFR2022_5-1663231721872.png

The current outcome of my measure is:

JFR2022_7-1663232050936.png

 

The numbers in green are my desired results.

What do I need to adjust to make this work?

 

Thanks in advance! 🙂

 

 

2 REPLIES 2
JFR2022
Frequent Visitor

Hi @daXtreme, thanks for your answer.

 

I It would require me to make another datetable with 365 rows (days) per stock item? I can't add the missing dates in my current planned table because that table is not date driven but order driven.

 

Does the new table needs to look something like this based on my earlier example? (where "planned quantity" is the sum of column "TargetQuantity" per articlenr in my "Planned" table.

Note: I have more than 500 unique stockitems which are all present in table "stock_per_item" with column "Articlenr". As an example i've added articlenr 35050.

JFR2022_0-1663597506317.png

 

Can you recommend any tutorial or tips to create such a table?

 

I appreciate your help! 🙂

daXtreme
Solution Sage
Solution Sage

Hi @JFR2022 

 

If you have missing dates in any of your tables, insert the missing dates into them with figures that will make your calculations correct. To complete your tables, please use Power Query.

Helpful resources

Announcements
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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 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.