How to calculate Gross Margin Return on Inventory (GMROI)

GMROI shows how much gross margin you earn for each unit of money invested in inventory.

Formula

GMROI = gross margin ÷ average inventory cost

SQL query

This example assumes: sales(category, sold_at, revenue, cogs), inventory_snapshots(category, as_of, value). It is written in PostgreSQL syntax; date functions differ slightly in MySQL, BigQuery and SQLite, and your column names will differ from these.

SELECT s.category,
       SUM(s.revenue - s.cogs)                                    AS gross_margin,
       i.avg_inventory,
       SUM(s.revenue - s.cogs) / NULLIF(i.avg_inventory, 0)        AS gmroi
FROM sales s
JOIN (SELECT category, AVG(value) AS avg_inventory FROM inventory_snapshots
      WHERE as_of >= DATE '2026-01-01' GROUP BY category) i
  USING (category)
WHERE s.sold_at >= DATE '2026-01-01'
GROUP BY s.category, i.avg_inventory
ORDER BY gmroi DESC;

Common mistakes that make Gross Margin Return on Inventory (GMROI) wrong

  • Average inventory must be at cost, matching how COGS is measured.
  • A category with a high margin but very slow turnover can still tie up cash.
  • Compare at category level; whole-store GMROI hides weak lines.

Ask for Gross Margin Return on Inventory (GMROI) in plain English

Instead of writing the query yourself, you can type the question. SchemaChat turns it into SQL against your connected database or uploaded file, runs it, and shows the SQL and the figures it used so you can check the answer before you share it. It does not replace your judgement about the definition: check that the query matches the formula your business uses.

  • Which categories give the best GMROI?
  • Where is inventory earning the least margin?

Frequently asked questions

What is Gross Margin Return on Inventory (GMROI)?
GMROI shows how much gross margin you earn for each unit of money invested in inventory.
How do you calculate Gross Margin Return on Inventory (GMROI)?
GMROI = gross margin ÷ average inventory cost. The SQL example on this page shows the same calculation against a simple table.
What commonly goes wrong when calculating Gross Margin Return on Inventory (GMROI)?
Average inventory must be at cost, matching how COGS is measured.