AI Reports

Guides › Sales

How to see your best-selling products in Magento

Short answer: use Reports › Products › Bestsellers, but refresh its statistics first or it shows old numbers. For revenue, a custom date range or a list you can sort, use the query below.

In the admin: the Bestsellers report

  1. Go to Reports › Statistics › Refresh Statistics, tick Bestsellers, and choose Refresh Lifetime Statistics from the Actions menu. The report is only as fresh as this refresh.
  2. Go to Reports › Products › Bestsellers, choose the period and the dates, and click Show Report.

The catch: it shows quantity, not revenue or number of orders, and it's easy to forget the refresh.

With one query

Top 20 products by quantity sold between two dates, with the number of orders and revenue. Canceled and fully refunded orders are left out. A configurable product is counted once, under its own SKU, whichever variant was bought. The query is the same for Open Source and Adobe Commerce.

These queries only read data. Run them on a copy of your database if you can, or ask your developer to. If your tables have a prefix (set in app/etc/env.php), add it to each table name.

SET @from = '2026-10-01';   -- first day (inclusive)
SET @to   = '2026-11-01';   -- day after the last day (exclusive)

SELECT
  (SELECT p.sku FROM catalog_product_entity p WHERE p.entity_id = i.product_id LIMIT 1) AS sku,
  MAX(i.name)                     AS name,
  SUM(i.qty_ordered)              AS qty_sold,
  COUNT(DISTINCT i.order_id)      AS orders,
  ROUND(SUM(i.base_row_total), 2) AS revenue_before_discounts
FROM sales_order_item i
JOIN sales_order o ON o.entity_id = i.order_id
WHERE o.created_at >= @from AND o.created_at < @to
  AND o.state NOT IN ('canceled', 'closed')   -- closed = fully refunded
  AND i.parent_item_id IS NULL
GROUP BY i.product_id
ORDER BY qty_sold DESC
LIMIT 20;

Two things to know: order dates are stored in UTC, so a day near midnight can shift for your time zone, and revenue is before discounts, without tax, in your base currency.

More guides

Gaurav Harsh

Gaurav Harsh is a Magento developer who works on large Adobe Commerce stores and builds AI Reports, a Magento extension for asking your store's data questions in plain English. LinkedIn