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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
radhixzJG
New Member

Need to Create an Inventory Forecast by weeks based on an Actual Stock, new orders

Hello team,

 

i have this issue that need to be solve, i have try every combination of measures and still stock and how to make my forecast move on.  

Basically the only table where i have a date is the Orders_to_come.  All the models that i saw about forecasting use the sales from previous years but i don't have that data, just the data that i show below.

 

So at the end i need to present something like this  ( the numbers in each time intelligence column should be the forecast inventory.  

item/brand/locyear-week      
 2024-302024-312024-322024-33 2025-012025-02
x2565515120321023
x231214526352124586
        
        

 

 

For example i have this table for stocks

 

item_iditem_locbrandtypequantity
x2565200x_brandtshirt10
x2565100x_brandtshirt15
x2312200y_brandshirt20

 

forecast__demand_month

item_iditem_locproject_montly_sales
x256520010
x25651005
x23122006

 

Orders_to_come

item_iditem_locexpected_datequantity
x256520008/20/2024100
x256510009/20/202450
x231220008/15/202412

 

 

if any one could show me a way to start this part it would be wonderfull.  

3 REPLIES 3
bhanu_gautam
Super User
Super User

@radhixzJG ,First make sure you have one date table

DAX
DateTable =
ADDCOLUMNS (
CALENDAR (DATE(2024, 1, 1), DATE(2025, 12, 31)),
"Year", YEAR([Date]),
"Month", MONTH([Date]),
"Year-Month", FORMAT([Date], "YYYY-MM")
)

 

Create a mesure for Weekly Forecast

 

 WeeklyForecastDemand =
    DIVIDE (
        SUM('forecast_demand_month'[project_montly_sales]),
        4
    )
 
Then calculate inventory forecast
ForecastInventory =
VAR CurrentWeek = MAX('DateTable'[Date])
VAR InitialStock =
CALCULATE (
SUM('stocks'[quantity]),
FILTER (
'stocks',
'stocks'[item_id] = MAX('forecast_demand_month'[item_id]) &&
'stocks'[item_loc] = MAX('forecast_demand_month'[item_loc])
)
)
VAR IncomingOrders =
CALCULATE (
SUM('Orders_to_come'[quantity]),
FILTER (
'Orders_to_come',
'Orders_to_come'[item_id] = MAX('forecast_demand_month'[item_id]) &&
'Orders_to_come'[item_loc] = MAX('forecast_demand_month'[item_loc]) &&
'Orders_to_come'[expected_date] <= CurrentWeek
)
)
VAR ForecastedDemand =
CALCULATE (
SUMX (
DATESINPERIOD('DateTable'[Date], CurrentWeek, -7, DAY),
[WeeklyForecastDemand]
),
FILTER (
'forecast_demand_month',
'forecast_demand_month'[item_id] = MAX('forecast_demand_month'[item_id]) &&
'forecast_demand_month'[item_loc] = MAX('forecast_demand_month'[item_loc])
)
)
RETURN
InitialStock + IncomingOrders - ForecastedDemand
 
use this in matrix visual



Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






Hi Bhanu,

 

Thanks for your answer,  I tried the approach but the initial inventory it's not moving correctly.

 

i'm trying other stuffs.

Thanks Bhanu,

 

I create the calendar table and make all the DAX measures, but the initial stock that is supposed to move each week with the final result from last week is not working.  it's supposed to do like this

 

        ORDERS TO COME     
ITEMLOCATIONDEMANDWEEKON HAND   7/29/20248/11/20248/18/20249/27/202410/2/2024 
RSS100   401,896.00   100,474.00   348,783.00   163200365160579360320280206040 
              
              
     303132333435363738
        248,309.00   311,035.00   210,561.00                475,247.00   954,133.00   853,659.00   753,185.00   652,711.00   552,237.00

 

but it's generating something this

JGomez_2012_1-1721915161189.png

 

 

 

 

 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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