Short answer: a cohort is the group of customers who first bought (or signed up) in the same month. Retention in month n = customers of the cohort active in the n-th month after their first / the cohort's size. Shown as a triangle (cohorts down, months since first purchase across, a heat-map colour), it answers two questions a single churn number cannot: when in their life customers leave, and whether newer cohorts stay better than older ones.
A churn rate of 3% mixes customers in their first month with customers of five years. Cohorts separate them, so you can see whether last quarter's onboarding change actually kept people.
How does a cohort triangle look?
| Cohort | Size | M0 | M1 | M2 | M3 | M4 | M5 |
|---|---|---|---|---|---|---|---|
| Apr 2026 | 410 | 100% | 38% | 29% | 25% | 23% | 22% |
| May 2026 | 380 | 100% | 36% | 28% | 24% | 22% | |
| Jun 2026 | 450 | 100% | 41% | 32% | 28% | ||
| Jul 2026 | 500 | 100% | 44% | 35% | |||
| Aug 2026 | 520 | 100% | 45% | ||||
| Sep 2026 | 480 | 100% |
Read across a row for one cohort's life; read down a column to compare cohorts at the same age. Here month-1 retention rose from 36 to 45% from June: something changed for the better.
- Apr
- May
- Jun
What is the DAX?
Add two calculated columns to Sales (or build them in Power Query), and a small axis table:
-- calculated columns on Sales
First Purchase Month =
VAR C = Sales[Customer ID]
RETURN EOMONTH ( CALCULATE ( MIN ( Sales[Date] ), ALL ( Sales ), Sales[Customer ID] = C ), -1 ) + 1
Months Since First =
( YEAR ( Sales[Date] ) - YEAR ( Sales[First Purchase Month] ) ) * 12
+ MONTH ( Sales[Date] ) - MONTH ( Sales[First Purchase Month] )
-- calculated table for the columns of the matrix
Cohort Age = GENERATESERIES ( 0, 24 )Put Sales[First Purchase Month] on the matrix rows and 'Cohort Age'[Value] on its columns (no relationship), then:
Cohort Size =
CALCULATE ( DISTINCTCOUNT ( Sales[Customer ID] ), Sales[Months Since First] = 0 )
Active in Month n =
VAR N = SELECTEDVALUE ( 'Cohort Age'[Value] )
RETURN CALCULATE ( DISTINCTCOUNT ( Sales[Customer ID] ), Sales[Months Since First] = N )
Retention % = DIVIDE ( [Active in Month n], [Cohort Size] )Apply a background colour scale to Retention % for the heat map (conditional formatting). Remove any Date slicer from the page, or filter only on First Purchase Month, because a date filter would cut off the later months of each cohort.
What does "active" mean?
- Shops: bought at least once in that month (as above).
- Subscriptions: still subscribed at the end of the month; use start and end dates instead of orders.
- Apps: used the product in that month or week (see DAU/MAU).
Unbounded retention ("bought in month n or later") is smoother and suits products bought rarely.
What goes wrong?
- Date slicers on the page. They cut cohorts short; filter by cohort month only.
- Incomplete months. The newest cohort's last column is a partial month; hide ages that have not fully passed.
- Tiny cohorts. 30 customers swing by 3 points per customer; show the size column.
- Calculated columns on huge tables. For millions of rows, compute first purchase month in Power Query or the source.
Where can you check this?
- Microsoft Learn: GENERATESERIES function (DAX)
- Microsoft Learn: Apply conditional formatting in tables and matrixes
- Microsoft Learn: EOMONTH function (DAX)
Where do you start?
Build the triangle for the last twelve monthly cohorts and compare month-1 retention down the column. Customer lifetime value turns retention into money.