# Churn rate: Formula and dbt YAML | Silicon

URL: https://meetsilicon.com/metrics/churn-rate/

> Churn rate is the percentage of customers who cancel or stop paying during a period.

## Formula
Churn rate = customers lost during period / customers at start of period
## Why it matters
Churn sets the ceiling on growth. If churn is high, acquisition spend just refills a leaking bucket.
## Common pitfalls
- Decide whether downgrades count as churn; most teams track them separately as contraction.
## 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_customer_periods
meta:
metrics:
churn_rate:
type: number
sql: ${customers_churned} / NULLIF(${customers_at_start}, 0)
format: percent
description: Share of customers lost
columns:
- name: customer_id
meta:
metrics:
customers_at_start:
type: count_distinct
filters:
- was_active_at_start: true
description: Customers active at period start
- name: churned_customer_id
meta:
metrics:
customers_churned:
type: count_distinct
description: Customers who churned in the period
Once it's defined, anyone can ask about churn rate in plain English and get an answer built on this definition. See the metrics reference for every option.
## Related
- Retention rate ->
- Net revenue retention (NRR) ->
- 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
