EnableYourData.com

KPI · Inventory, purchasing and production

Days inventory outstanding (DIO): formula and example.

Days inventory outstanding (DIO) is the average number of days stock is held before it is sold. Together with days sales outstanding (DSO) and days payable outstanding (DPO), it makes up the cash conversion cycle. Fewer days means cash comes back out of stock more quickly.

Days inventory outstanding (DIO) formula

Average inventory value ÷ cost of goods sold × number of days in the period

Worked example

In the first quarter of 2026 (90 days) Acme Groothandel had average inventory of €1,200,000 and cost of goods sold of €1,350,000. DIO is €1,200,000 ÷ €1,350,000 × 90 = 80 days.

Fictitious figures for Acme Groothandel, a sample wholesaler.

How to read this KPI

A lower number means less working capital is tied up in stock. If DIO rises while revenue stays flat, stock is growing faster than sales. Compare with the same period last year, with supplier lead times and by product group; seasonal buying can distort the picture temporarily.

Pitfalls with days inventory outstanding (DIO)

  • Comparing a quarter or month with an annual figure without adjusting the number of days.
  • Taking inventory value on a single date just after a large inbound delivery.
  • Including or excluding stock in transit or on consignment without recording the choice.

SQL & DAX

Calculating days inventory outstanding (DIO) 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 cogs AS (
  SELECT date_trunc('month', o.order_date) AS month,
         SUM(ol.quantity * ol.unit_cost) AS cogs
  FROM order_lines ol
  JOIN orders o ON o.order_id = ol.order_id
  GROUP BY 1
),
stock AS (
  SELECT date_trunc('month', snapshot_date) AS month,
         SUM(value) / COUNT(DISTINCT snapshot_date) AS avg_value
  FROM stock_levels
  GROUP BY 1
)
SELECT c.month,
       ROUND(s.avg_value / NULLIF(c.cogs, 0)
             * EXTRACT(day FROM c.month + interval '1 month' - interval '1 day'), 1) AS dio_days
FROM cogs c
JOIN stock s ON s.month = c.month
ORDER BY c.month;
DAX · Power BI
Average Inventory Value = AVERAGEX(VALUES(Stock[SnapshotDate]), CALCULATE(SUM(Stock[Value])))
DIO = DIVIDE([Average Inventory Value], SUMX(Sales, Sales[Quantity] * Sales[UnitCost])) * COUNTROWS('Date')

In ENABLE

Tracking this KPI in ENABLE

Plain-language questions

Ask for days inventory outstanding (DIO) 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 days inventory outstanding?

Divide average inventory value by cost of goods sold and multiply by the number of days in the period. Use 365 for a year and about 90 for a quarter. Value inventory and cost of goods sold on the same basis.

How does DIO fit into the cash conversion cycle?

The cash conversion cycle is DIO plus DSO minus DPO. Every day you take out of inventory shortens the time between paying your supplier and getting paid by your customer. That is why finance and operations often look at this figure together.

What is the difference between DIO and days of supply?

DIO looks backwards and uses value: how long stock was held on average, based on cost of goods sold. Days of supply looks forwards and uses units: how many days current stock will last at expected demand. The first is a working capital measure, the second a replenishment measure.

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.