How to calculate EBITDA Margin

EBITDA margin is earnings before interest, tax, depreciation and amortisation as a percentage of revenue.

Formula

EBITDA margin % = (operating income + depreciation + amortisation) ÷ revenue × 100

SQL query

This example assumes: ledger(period, category, amount) with category in 'revenue', 'cogs', 'opex', 'depreciation', 'amortisation'. It is written in PostgreSQL syntax; date functions differ slightly in MySQL, BigQuery and SQLite, and your column names will differ from these.

SELECT period,
       (SUM(amount) FILTER (WHERE category = 'revenue')
      - SUM(amount) FILTER (WHERE category IN ('cogs', 'opex'))) * 100.0
         / NULLIF(SUM(amount) FILTER (WHERE category = 'revenue'), 0) AS ebitda_margin_pct
FROM ledger
WHERE category <> 'depreciation' AND category <> 'amortisation'
GROUP BY period
ORDER BY period;

Common mistakes that make EBITDA Margin wrong

  • If depreciation is recorded inside 'opex' in your ledger, add it back or the figure is operating income, not EBITDA.
  • Adjusted EBITDA excludes extra items by management choice; label it adjusted.
  • EBITDA is not cash flow: it ignores tax, interest and working-capital changes.

Ask for EBITDA Margin 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.

  • What was our EBITDA margin last year?
  • How does EBITDA margin compare with operating margin?

Frequently asked questions

What is EBITDA Margin?
EBITDA margin is earnings before interest, tax, depreciation and amortisation as a percentage of revenue.
How do you calculate EBITDA Margin?
EBITDA margin % = (operating income + depreciation + amortisation) ÷ revenue × 100. The SQL example on this page shows the same calculation against a simple table.
What commonly goes wrong when calculating EBITDA Margin?
If depreciation is recorded inside 'opex' in your ledger, add it back or the figure is operating income, not EBITDA.