Retention

Calculates gross and net revenue retention, churn, and logo retention from aggregated MRR and customer counts.

Purpose

Provide a standardized retention metrics view, translating MRR movements and customer churn into commonly used SaaS retention KPIs.

This model is designed as a diagnostic reporting layer, enabling:

  • Gross Revenue Retention and Net Revenue Retention analysis
  • Separation of revenue churn vs logo churn
  • Comparable retention metrics across periods and scenarios

It aligns revenue-based and quantity-based retention perspectives in a single table.

Business Logic

  • Start from MRR Aggregated
  • Join with Customer Count View
  • Calculate retention metrics using current-period MRR as the baseline
  • Express all outputs as ratios (percent-ready)
  • Produce one row per date and value type

Output Contract

Definitions

ColumnDescription
dateDate of the snapshot (YYYY-MM-DD)
value_typeIndicator such as actual, budget
gross_revenue_retentionRevenue retained excluding upsell
net_revenue_retentionRevenue retained including upsell
churn_valueRevenue churn rate
churn_qtyCustomer churn rate
logo_retentionLogo retention rate

Sample & Implementation

Revenue and logo retention metrics derived from MRR and customer counts.
datevalue_typegross_revenue_retentionnet_revenue_retentionchurn_valuechurn_qtylogo_retention
2025-01-01budget0.99160.99290.00830.00830.9917
2025-02-01budget0.99570.9970.00430.00430.9957
2025-03-01budget0.99570.9970.00420.00420.9958
2025-04-01budget0.99580.99710.00420.00420.9958
2025-05-01budget0.99580.99710.00410.00410.9959
2025-06-01budget0.99590.99710.0040.0040.996
2025-07-01budget0.99570.99690.00430.00430.9957
2025-08-01budget0.99570.99690.00420.00420.9958
2025-09-01budget0.99580.9970.00420.00420.9958
2025-10-01budget0.99580.9970.00410.00410.9959
{{config(materialized='view')}}


with mrr_aggregated as (
    select * from {{ ref('mrr_aggregated') }}
),

customer_count_view as (
    select * from {{ref('customer_count_view')}}
)

select
    mrr.date,
    mrr.value_type,
    (mrr.current_base - mrr.downsell - mrr.churn) / mrr.current_base as gross_revenue_retention,
    (mrr.current_base - mrr.downsell - mrr.churn + mrr.upsell) / mrr.current_base as net_revenue_retention,
    mrr.churn / mrr.current_base as churn_value,
    ccv.churn / ccv.current_base as churn_qty,
    - (ccv.churn / ccv.current_base) + 1 as logo_retention
from mrr_aggregated mrr
left join customer_count_view ccv on ccv.date = mrr.date and ccv.value_type = mrr.value_type

Dependencies

On this page

Star us on GitHub

If you enjoy this content and find it useful, give us a star on GitHub to show your support and stay updated with our latest improvements.