EnableYourData.com

KPI · E-commerce

Contribution margin per order: formula and example.

Contribution margin per order is the revenue from an order minus every cost directly tied to that order, such as product cost, shipping, payment fees and packaging. It is the amount left over to cover fixed costs like staff and rent. It shows whether an order is genuinely profitable rather than just adding revenue.

Contribution margin per order formula

Revenue per order − product cost − shipping cost − payment fees − packaging cost

Worked example

An average Acme Groothandel order brings in €150 excluding VAT. Product cost is €84, shipping €7.50, payment fees €1.50 and packaging €2.00. Contribution margin is €150 − €84 − €7.50 − €1.50 − €2.00 = €55, or €55 ÷ €150 × 100% = 36.7% of revenue.

Fictitious figures for Acme Groothandel, a sample wholesaler.

How to read this KPI

A higher contribution margin per order means each order contributes more to fixed costs and profit. Compare it by channel, product category and order size: small orders with free shipping, or marketplace orders carrying commission, often contribute far less. Rising revenue with a falling contribution margin per order is a cue to review pricing, shipping terms or discounts.

Pitfalls with contribution margin per order

  • Deducting only product cost and forgetting shipping, payment and packaging costs.
  • Leaving out return costs, which take a large bite out of margin in some categories.
  • Allocating fixed costs such as salaries per order, so the figure no longer shows what one extra order earns.

SQL & DAX

Calculating contribution margin per order 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 order_id, SUM(quantity * unit_cost) AS cogs
  FROM order_lines
  GROUP BY order_id
)
SELECT date_trunc('month', o.order_date) AS month,
       COUNT(*) AS orders,
       ROUND(AVG(o.total_amount - c.cogs - o.shipping_cost), 2) AS contribution_margin_per_order
FROM orders o
JOIN cogs c ON c.order_id = o.order_id
WHERE o.status <> 'cancelled'
GROUP BY 1
ORDER BY 1;
DAX · Power BI
Contribution Margin per Order =
DIVIDE(
    SUM(Orders[total_amount])
        - SUMX(OrderLines, OrderLines[quantity] * OrderLines[unit_cost])
        - SUM(Orders[shipping_cost]),
    DISTINCTCOUNT(Orders[order_id])
)

In ENABLE

Tracking this KPI in ENABLE

Plain-language questions

Ask for contribution margin per order 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 contribution margin per order?

Subtract all variable costs from the order's revenue: product cost, shipping, payment fees, packaging and any commission. With €100 in revenue, €55 product cost and €10 of other variable costs, contribution margin is €35. Work with revenue excluding VAT.

What is the difference between contribution margin and gross margin?

Gross margin is revenue minus only the cost of goods sold. Contribution margin also deducts all other variable costs, such as shipping and payment fees. For an online shop, contribution margin therefore gives a fairer picture of what an order earns.

Which costs belong in ecommerce contribution margin?

Include every cost that moves with the number of orders: product cost, shipping, packaging, payment fees, marketplace commission and return costs. Leave out fixed costs such as salaries, rent and software. Some teams also deduct advertising cost per order; if you do, say so in the definition.

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.