Magento 2 SQL queries › Orders and sales
What's our average order value per month this year?
Short answer: Magento's Sales report shows totals and order counts per period; divide one by the other. Or run one query that returns AOV for every month this year.
In the Magento admin
- Refresh the Orders statistics in Reports › Statistics.
- Open Reports › Sales › Orders, set Period to Month and the dates to this year.
- Divide Sales Total by Orders for each row.
With one query
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.
Works on Magento Open Source and Adobe Commerce:
SELECT DATE_FORMAT(o.created_at, '%Y-%m') AS month,
COUNT(*) AS orders,
ROUND(AVG(o.base_grand_total), 2) AS avg_order_value
FROM sales_order o
WHERE o.state <> 'canceled'
AND o.created_at >= DATE_FORMAT(CURRENT_DATE, '%Y-01-01')
GROUP BY month
ORDER BY month;
Good to know
- Grand total includes shipping and tax. For AOV on products only, use
base_subtotalinstead. - Refunded orders still count here; subtract
base_total_refundedif you want net AOV.