How to Calculate Days Sales in Inventory in Shopify
Days sales in inventory (DSI) is average inventory divided by cost of goods sold, then multiplied by the number of days in the period. The result is the average number of days your stock sits before it sells.
A store-wide DSI hides the SKUs that actually drain cash. Calculate it at variant level, on matching dates, using inventory at cost (not retail price). Shopify does not print DSI as a default report, so you assemble it from inventory value and the cost of units sold.
Days sales in inventory formula
The standard formula, as Shopify publishes it, is:
DSI = (Average inventory / Cost of goods sold) x 365
If you review a month or a quarter instead of a year, keep the multiplier equal to the length of that same window. A 30-day DSI uses beginning and ending inventory from that 30-day window (averaged as described below), 30-day COGS, and a multiplier of 30. Mixing a year of inventory with a month of COGS will produce a useless number.
Average inventory
Average inventory is beginning inventory plus ending inventory, divided by two. Both figures should be the cost of stock on hand, not the selling price. That two-point average is an approximation. A true period average would need more frequent snapshots (weekly or daily). The two-point method can misstate DSI on short windows or highly seasonal SKUs if stock spiked or dropped in the middle of the period.
On Shopify, the closest default source is the Month-end inventory value report. That report multiplies each variant’s cost per item by its ending Available quantity. Available excludes committed units on unfulfilled orders and incoming units on transfers.
Cost of goods sold
COGS is the cost of what you sold in the period, not revenue. Accounting COGS is beginning inventory plus purchases minus ending inventory. For a Shopify operator, the practical stand-in is the Cost column on gross profit reports, which totals the cost of units sold when cost was recorded at the time of sale.
Shopify’s cost per item field is the amount you enter on the product. For a resale SKU, Shopify describes this as the price paid to the manufacturer, excluding taxes, shipping, or other costs. If you leave shipping and landed costs out of that field, DSI will understate how much capital is actually sitting in stock.
DSI is undefined when a SKU has zero COGS (you cannot divide by zero). Negative or near-zero COGS, which can appear when returns exceed sales or cost data is missing, produces a misleading or inverted result. At variant level, exclude those SKUs from the DSI ranking, or flag them separately until cost and sales data are complete.
Worked example
Take a 365-day window. Beginning inventory at cost is $40,000. Ending inventory at cost is $50,000. Cost of goods sold for the year is $180,000.
- Average inventory = ($40,000 + $50,000) / 2 = $45,000
- DSI = ($45,000 / $180,000) x 365 = 91.25 days
That store needs about 91 days, on average, to turn its stock into sales. Now split the same year by SKU.
- SKU A: average inventory $5,000, COGS $40,000. DSI = ($5,000 / $40,000) x 365 = 45.6 days.
- SKU B: average inventory $12,000, COGS $20,000. DSI = ($12,000 / $20,000) x 365 = 219 days.
SKU A turns in about a month and a half. SKU B ties up cost for more than seven months. The store-wide 91-day figure would have buried SKU B.
How to pull DSI inputs from Shopify
Set cost per item first. Profit is reported only for products and variants that had cost recorded at the time they were sold, according to Shopify’s profit reports documentation. Missing cost makes both COGS and inventory value incomplete.
- In Shopify admin, open Products, then open a product. In Pricing, enter Cost per item and save. Repeat for variants, or use the bulk editor or a CSV import so the catalog is consistent.
- Open Analytics, then Reports. Filter Category to Inventory. Open Month-end inventory value. For a January–December year, beginning inventory is the December snapshot from the year before (the close immediately before the period starts). Ending inventory is the December snapshot of the year you are measuring. Do not use January’s month-end total as beginning inventory; that figure is January’s close, not the open.
- Still in Reports, filter Category to Profit Margin. Open Gross profit by product or Gross profit by product variant. Set the same date range. Use the Cost column as COGS for that window.
- Compute average inventory, divide by Cost, and multiply by the number of days in the range. Repeat at variant level for anything in your top revenue tier. Skip or flag variants with no sales, returns exceeding sales, or missing cost, so you do not divide by zero or a near-zero Cost.
Shopify’s inventory-based metrics only go back to October 1, 2023. If your period starts before that date, do not pair a later inventory snapshot with COGS from the original, longer window. Either restrict both inventory and COGS to the window Shopify can actually cover (beginning inventory is the earliest available snapshot, ending inventory and COGS match that same shorter window, and the multiplier equals the days in that window), or pull the missing beginning-inventory balance from accounting records so the inventory dates still match the COGS period. Deleted locations drop out of historical inventory. Variants deleted after January 14, 2026 drop out after the deletion date, according to Shopify’s inventory reports documentation.
Cost per item is static. If you change it mid-period, older sales still carry the cost that was stored at the time of sale, and month-end value uses the current cost on remaining units. Keep that mismatch in mind when a supplier price just moved.
DSI versus Shopify days of inventory remaining
Shopify’s Inventory remaining per product report answers a different question. Days of inventory remaining is ending quantity divided by average units sold per day, and that daily rate is based on sales over the last 28 days. It is a unit-based estimate of how long current stock will last.
DSI is a cost-based average of how long inventory sat during a closed period. A SKU can show 12 days remaining (about to stock out) and still have a high annual DSI if it sat for months before the recent spike. Use both numbers before you reorder or markdown.
| Metric | Question it answers | Usual Shopify source |
|---|---|---|
| Days sales in inventory | How many days of COGS you hold at average inventory cost | Month-end inventory value plus Cost on gross profit reports |
| Days of inventory remaining | How many days until a variant runs out at recent unit velocity | Inventory remaining per product |
| Sell-through rate | What share of stock sold in the period | Products by sell-through rate |
| Inventory-to-sales ratio | How much inventory capital sits per dollar of sales | Inventory value divided by net sales |
What a high or low DSI means
According to Shopify, an ideal DSI is typically between 30 and 60 days, and the range still shifts by industry and business size. Treat that band as a diagnostic, not a target you force onto every SKU.
A high DSI means stock is converting slowly. Cash is sitting in units. Carrying cost rises, and the SKU is a candidate for markdowns, bundles, or a paused purchase order. A rising DSI across several periods is often aging inventory in disguise. Check the inventory aging report before you buy more of the same variant.
A low DSI means stock converts quickly. That can be healthy. It can also mean you are running too lean for your lead time. Shopify notes that a DSI shorter than a month can point to stockout risk if you do not raise on-hand quantity or safety stock. Pair the number with days of inventory remaining and supplier lead time before you cut a reorder.
Do not compare DSI across unrelated categories. A replenishable consumable should turn faster than a made-to-order or high-ticket SKU. Compare a variant to its own history and to similar SKUs in the same collection.
How to use DSI with other stock metrics
DSI tells you how long cost sits. It does not tell you whether the SKU is about to run out, what share of units sold, or how much capital you need per dollar of revenue. Read it next to sell-through rate and the inventory-to-sales ratio.
- High DSI and low sell-through: excess stock. Stop replenishing and clear units.
- Low DSI and falling days remaining: demand is outrunning cover. Reorder now.
- Healthy DSI with a stockout in the middle of the period: the average hid a missed-sales gap. Rebuild cover, then look at demand, not the average alone.
- High DSI on a C-grade SKU: do not fund it the way you fund an A-grade bestseller.
Rank the catalog with ABC analysis so A-grade variants get a weekly DSI check and long-tail SKUs get a monthly pass. Store-wide DSI calculated once a quarter will not catch a bestseller drifting toward a stockout.
What to do when DSI is off
Match the action to the cause. One store-wide discount will not fix a mixed catalog.
- DSI high, recent velocity steady: discount, bundle with a faster mover, or pause the next purchase order until cover falls.
- DSI high, velocity falling: stop ads on that variant, stop replenishment, and clear aging units before the next season.
- DSI low, demand strong: place the reorder using lead time and daily sales, not last year’s average cover. Use a reorder-point formula so the PO leaves before days remaining hits zero.
- DSI low only because the SKU stocked out: treat the gap as lost demand, then raise safety stock. A forecast that used the stockout weeks as “true demand” will under-buy again.
For the reorder-point math, use the Shopify reorder formula (lead time x daily sales, plus safety stock). For the forward look, ecommerce demand forecasting tells you whether current velocity is about to spike or fade, which a closed-period DSI cannot.
Pull DSI for your A-grade SKUs every week from the two Shopify exports above. Continuous stock intelligence that watches on-hand quantity and sales velocity can flag stockout risk while you still have time to place the PO. DSI itself stays a cost calculation you run on inventory value and COGS.