# Net revenue retention (NRR): Formula and dbt YAML | Silicon

URL: https://meetsilicon.com/metrics/net-revenue-retention/

> Net revenue retention is the percentage of recurring revenue kept from existing customers over a period, including expansion and after churn and contraction.

## Formula
NRR = (starting MRR + expansion − contraction − churned MRR) / starting MRR
## Why it matters
NRR above 100% means the existing customer base grows on its own. It is one of the strongest signals of product value in SaaS.
## Common pitfalls
- Only include customers who existed at the start of the period.
## Define it in dbt for Silicon
Add this to your model's YAML. Aggregate metrics sit under a column's meta.metrics; ratios are type: number metrics that reference other metrics. Rename models and columns to match your project.
schema.yml Copy
models:
- name: fct_mrr_movements
meta:
metrics:
net_revenue_retention:
type: number
sql: ${ending_mrr} / NULLIF(${starting_mrr}, 0)
format: percent
description: Revenue kept and grown from existing customers
columns:
- name: starting_mrr
meta:
metrics:
starting_mrr:
type: sum
description: MRR at period start from existing customers
- name: ending_mrr
meta:
metrics:
ending_mrr:
type: sum
description: MRR at period end from the same customers
Once it's defined, anyone can ask about net revenue retention in plain English and get an answer built on this definition. See the metrics reference for every option.
## Related
- Retention rate ->
- Churn rate ->
- Average revenue per user (ARPU) ->
- Semantic layer ->
## Tell us where your data lives today.
Book 30 minutes with the founder. Tell us where your data is today, and see Silicon running on sample data.
Talk to Sujay
30-minute call with the founder
