Inventory how-to

How to use moving averages to forecast sales

A moving average takes your recent sales for a SKU and averages them over a fixed window, so you get a daily sales rate that is not thrown off by one unusual day.

Short answer: A moving average takes your recent sales for a SKU and averages them over a fixed window, so you get a daily sales rate that is not thrown off by one unusual day. Use a 28 day window for most products, and recalculate it regularly as new sales come in so the forecast stays current.

What a moving average actually does

A moving average smooths out noise. Instead of looking at yesterday's sales or last week's sales alone, you add up units sold over a set number of days and divide by that number of days. This gives you a daily sales rate you can trust more than any single day's number, because single days can be skewed by a promotion, a restock notification, or just randomness.

Choosing your window length

Shorter windows (7 days) react fast to recent changes but swing a lot with noisy data. Longer windows (28 to 60 days) are steadier but slower to pick up real shifts in demand. A 28 day window is a reasonable default for most small store SKUs because it covers about four weeks, which smooths out weekday and weekend patterns and typical restock timing.

Updating the average as you go

A moving average is not a one-time calculation. Each day or week, drop the oldest day from the window and add the newest one, then recompute. This keeps the forecast responsive to real trend changes like a product picking up after a review or slowing down after a season ends.

Watch for seasonality and one-off spikes

A plain moving average will understate demand right before a known seasonal peak and overstate it right after, because it is only looking backward. If you have about 13 months of sales history for a SKU, you can compare the same period last year to adjust the average up or down. Also strip out or flag obvious one-off spikes, like a single wholesale order, before they pull your average out of shape.

Step by step

  1. List daily units sold for the SKU over the last 28 days.
  2. Add up the total units sold across those 28 days.
  3. Divide by 28 to get the average daily sales rate.
  4. Each new day, drop the oldest day from your list and add the new day, then recalculate.
  5. Check if you have over a year of history, and if so compare this period to the same period last year to spot seasonal shifts.
  6. Flag and exclude one-off spikes, like a single large wholesale order, so they do not distort the average.
  7. Use the resulting daily rate in your reorder point and order quantity formulas.

Worked example

Say a SKU sold 3, 4, 2, 5, 3, 4, 3 units in a typical week, repeated roughly across a 28 day window for a total of 84 units sold. That gives a daily average of 84 / 28 = 3 units per day. If the supplier lead time is 10 days and you keep 4 safety days, your reorder point is 3 x (10 + 4) = 42 units. If you have 20 units on hand and none on order, and you want 14 days of cover, order quantity = 3 x (10 + 14) - 20 = 72 - 20 = 52 units, which you would then round up to the supplier's case pack size.

How SteadyShelf helps

SteadyShelf calculates this moving average for you automatically, using a 28 day window by default, and layers in seasonality once a SKU has about 13 months of history. You do not need to track the daily numbers yourself or remember to recalculate, but it still forecasts per variant at the store level, not per location.

$29/month flat, unlimited products and suppliers, 30-day free trial. Run the numbers now with the free reorder point calculator.

SteadyShelf is launching on the Shopify App Store. Join early access to get the install link first.

Related guides

All inventory how-to guides ยท Inventory glossary

FAQ

Why not just use last week's sales instead of a moving average?

Last week's sales can be skewed by one unusual day, like a big single order or a stockout that cut sales short. A moving average over several weeks smooths that out and gives a more reliable daily rate to plan reorders against.

What window length should I use for a new product with little sales history?

With limited history, use whatever full history you have, even if it is less than 28 days, and treat the average as rough until more data builds up. Avoid applying seasonality adjustments until you have at least a year of sales to compare against.

Let SteadyShelf do this math for every SKU

Order-by dates per supplier, seasonal forecasts and draft POs for your Shopify store. $29/month after a 30-day free trial.

Get early access