Functional Weave
Code in Rust

subscriptions.churn@1.0.0

README.md

2,052 bytes · view raw

# subscriptions.churn

The standard SaaS churn and retention rates for one period (usually a month),
all measured against the customers and MRR that existed at the start of it:

    logo churn             = customersLost / customersAtStart
    gross revenue churn    = (contraction + churned) / mrrAtStart
    net revenue churn      = (contraction + churned - expansion) / mrrAtStart
    gross revenue retention = (mrrAtStart - contraction - churned) / mrrAtStart
    net revenue retention  = (mrrAtStart + expansion - contraction - churned) / mrrAtStart

These are ChartMogul's published definitions (Gross MRR Churn Rate, Net MRR
Churn Rate and Net Revenue Retention), which are the ones most SaaS reporting
uses. Net revenue churn goes negative when expansion from existing customers
outweighs what they took away ("negative churn"), and net revenue retention
goes above 10000 (100%) in the same case. ChartMogul adds reactivation MRR to
expansion in NRR and net churn; if you want the same, pass expansion plus
reactivation as `expansionMrr`.

Every input is about the cohort at the start of the period. New customers who
joined during it, and the MRR they brought, are left out: they are growth,
not retention, and including them is the most common way churn gets
under-reported. A customer who joined and cancelled within the period is not
in `customersLost` either.

Each rate is one exact division rounded half-up (away from zero for a
negative net churn) to a whole basis point, so 1 lost out of 3 is 3333
(33.33%). A rate is null rather than an error when its denominator is zero: a
business with no customers at the start of the month has no churn rate, not a
churn rate of zero.

Errors: negative counts or amounts, more customers lost than there were, more
MRR contracted and churned than there was, and amounts in different
currencies.

Sources: ChartMogul, "Revenue churn (net and gross revenue churn rate)",
https://chartmogul.com/saas-metrics/revenue-churn/ and "Net Revenue Retention
(NRR)", https://chartmogul.com/saas-metrics/nrr/.