Fill rate and stockout rate: formulas and DAX

How to calculate fill rate by units, lines and orders, stockout rate as the share of product-days out of stock, lost sales estimates, the link to inventory turnover, the DAX on order lines and daily stock snapshots, and a heat map of stockouts by product and week.

Short answer: fill rate is the share of demand shipped from stock at the first attempt. Unit fill rate = units shipped / units ordered; line fill rate = lines shipped complete / lines ordered; order fill rate = orders shipped complete / orders, the strictest. Stockout rate = product-days with zero stock / all product-days (for products meant to be in stock). With 9,700 of 10,000 units shipped, unit fill rate is 97%, while order fill rate can be far lower, because one missing line spoils a whole order.

Fill rate is the customer's view of inventory, the counterpart to inventory turnover: turnover pushes stock down, fill rate shows when it went too low.

How do the three fill rates differ?

LevelOrderedShipped completeFill rate
Units10,0009,70097.0%
Lines2,5002,35094.0%
Orders1,00087087.0%
September, 1,000 orders with 2,500 lines and 10,000 units

The 300 missing units hit 150 lines spread over 130 orders: 3% of units become 13% of orders.

  • Unit fill rate
  • Order fill rate
020406080100W36W37W38W39
Unit and order fill rate by week (%)

What is the DAX?

From order lines with Ordered Qty and Shipped Qty (shipped at the first attempt):

Units Ordered = SUM ( OrderLines[Ordered Qty] )
Units Shipped = SUM ( OrderLines[Shipped Qty] )
Unit Fill Rate = DIVIDE ( [Units Shipped], [Units Ordered] )

Lines Complete =
CALCULATE ( COUNTROWS ( OrderLines ), FILTER ( OrderLines, OrderLines[Shipped Qty] >= OrderLines[Ordered Qty] ) )
Line Fill Rate = DIVIDE ( [Lines Complete], COUNTROWS ( OrderLines ) )

Order Fill Rate =
VAR Orders = VALUES ( OrderLines[Order ID] )
VAR Complete = FILTER ( Orders, CALCULATE ( [Lines Complete] = COUNTROWS ( OrderLines ) ) )
RETURN DIVIDE ( COUNTROWS ( Complete ), COUNTROWS ( Orders ) )

How do you measure stockouts?

From daily stock snapshots (one row per product per day, including zero stock), for active products:

Product Days = COUNTROWS ( Stock )
Stockout Days = CALCULATE ( [Product Days], Stock[On Hand] <= 0 )
Stockout Rate = DIVIDE ( [Stockout Days], [Product Days] )

-- rough lost sales: average daily units on days in stock × days out of stock
Lost Units Estimate =
SUMX (
    VALUES ( 'Product'[Product] ),
    VAR InStockDates = CALCULATETABLE ( VALUES ( Stock[Date] ), Stock[On Hand] > 0 )
    VAR UnitsInStock = CALCULATE ( SUM ( Sales[Quantity] ), TREATAS ( InStockDates, 'Date'[Date] ) )
    RETURN DIVIDE ( UnitsInStock, COUNTROWS ( InStockDates ) ) * [Stockout Days]
)

For each product, InStockDates lists the days it had stock, and TREATAS applies them to Sales through the Date table, so sales count only on in-stock days. A matrix of products by week with Stockout Days and a red colour scale shows patterns, such as the same products running out every month end.

What goes wrong?

  • Unit fill rate only. Looks fine while many orders are incomplete; show order fill rate.
  • Backorders shipped later counted as filled. Fill rate is about the first shipment.
  • Missing zero-stock rows. If snapshots skip products with no stock, stockouts disappear; generate a row per product per day.
  • Discontinued products. Leave them out of stockout rate, or it rises for products no one plans to stock.

Where can you check this?

Where do you start?

Report unit, line and order fill rate together by week, then the stockout heat map for the products behind the gap. Forecast accuracy is often the cause.

Keep reading

More from the blog.

Every post

Next

Building this? Say hello.

A question about this post, a pattern you would build differently, or the next thing you want written out: Behnia reads every message.