EnableYourData.com

KPI · Inventory, purchasing and production

Stockout rate: formula and example.

Stockout rate is the share of active products that have no stock at a given moment. You measure it daily and average it over a week or month. It shows how often a customer would find an empty shelf, before any order comes in.

Stockout rate formula

Product-days with zero stock ÷ total product-days × 100%

Worked example

Acme Groothandel has 2,400 active products. On an average day in March 2026, 84 of them had no stock. The stockout rate is 84 ÷ 2,400 × 100% = 3.5%.

Fictitious figures for Acme Groothandel, a sample wholesaler.

How to read this KPI

A lower rate means customers can buy straight away more often. Ideally weight the figure by revenue or sales frequency, because an empty slot on a fast seller costs far more than on an item that sells once a quarter. Compare with your own trend and look at which suppliers or product groups cause the gaps.

Pitfalls with stockout rate

  • Counting discontinued or seasonal items that are deliberately no longer stocked.
  • Looking only at the total across warehouses while one site has run dry.
  • Giving every product equal weight, so shortages on best sellers get lost.

SQL & DAX

Calculating stockout rate in SQL and DAX

Two examples on a fictitious data warehouse for Acme Groothandel: a PostgreSQL query and a measure for a Power BI model. Adjust table and column names to your own model.

SQL · PostgreSQL
WITH daily AS (
  SELECT snapshot_date, product_id, SUM(quantity) AS qty
  FROM stock_levels
  WHERE snapshot_date >= date_trunc('month', current_date) - interval '3 months'
  GROUP BY snapshot_date, product_id
)
SELECT date_trunc('month', snapshot_date) AS month,
       COUNT(*) AS sku_days,
       COUNT(*) FILTER (WHERE qty <= 0) AS stockout_days,
       ROUND(100.0 * COUNT(*) FILTER (WHERE qty <= 0) / NULLIF(COUNT(*), 0), 1) AS stockout_pct
FROM daily
GROUP BY 1
ORDER BY 1;
DAX · Power BI
SKU Days = COUNTROWS(SUMMARIZE(Stock, Stock[SnapshotDate], Stock[ProductID]))
Stockout Rate = DIVIDE(COUNTROWS(FILTER(ADDCOLUMNS(SUMMARIZE(Stock, Stock[SnapshotDate], Stock[ProductID]), "@Qty", CALCULATE(SUM(Stock[Quantity]))), [@Qty] <= 0)), [SKU Days])

In ENABLE

Tracking this KPI in ENABLE

Plain-language questions

Ask for stockout rate per month, customer or product in the SQL Explorer with AI. The AI writes the SQL, you see the query and run it yourself; the AI only receives metadata.

Read more →

In your Power BI dashboard

Define the KPI as a measure in your Power BI model and show it in the portal, with "Last refreshed" next to it. Access profiles and optional row-level security decide who sees which figures.

Read more →

Custom dashboards (pilot)

Add the KPI as a tile to a custom dashboard, compared with last year. The Dashboard Builder is a pilot and can be switched on per client.

Read more →

Monthly targets

With the built-in Targets app you set a target for the KPI per month, so you see actuals and target side by side.

Read more →

FAQ

Frequently asked questions

How do you calculate stockout rate?

Count each day how many active products have stock of zero or less and divide by the number of active products. Average the result over the days in the period. Decide upfront which products count as active.

What is the difference between stockout rate and fill rate?

Stockout rate measures your stock position, whether or not there was demand. Fill rate measures what happened to real orders: the share delivered complete straight from stock. An item can be out of stock without anyone ordering it, in which case only the first figure moves.

How do you reduce stockouts?

Start with the products that run out most often and cost the most revenue. Check their reorder point, safety stock and the supplier's actual lead time. The cause is often a lead time in the system that is shorter than reality.

Use AI on your own data. Securely, and without the headache.

In an online demo we show how ENABLE makes your data securely available and how you build on it: describing an app in the AI Builder, plain-language questions, dashboards and APIs. And how we set it up and manage it for you.