How to calculate Net Revenue Retention (NRR)
Net revenue retention shows how much recurring revenue you keep from existing customers after churn, downgrades and expansion.
Formula
NRR = (opening MRR + expansion − contraction − churn) ÷ opening MRR × 100SQL query
This example assumes: subscriptions(customer_id, started_at, ended_at, mrr), monthly_mrr(customer_id, month, mrr). It is written in PostgreSQL syntax; date functions differ slightly in MySQL, BigQuery and SQLite, and your column names will differ from these.
WITH cohort AS (
SELECT customer_id, mrr AS mrr_start
FROM monthly_mrr WHERE month = DATE '2025-10-01' AND mrr > 0
)
SELECT SUM(COALESCE(n.mrr, 0)) * 100.0 / NULLIF(SUM(c.mrr_start), 0) AS nrr_pct
FROM cohort c
LEFT JOIN monthly_mrr n
ON n.customer_id = c.customer_id AND n.month = DATE '2026-10-01';Common mistakes that make Net Revenue Retention (NRR) wrong
- Only customers who existed at the start belong in the calculation; new customers must not add to it.
- A single huge expansion can make NRR look healthy while most customers shrink; look at the distribution.
- NRR above 100% is possible with churn present; compare it with gross retention.
Ask for Net Revenue Retention (NRR) 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 is our net revenue retention over the last 12 months?
- Which customers expanded the most year over year?