EnableYourData.com

KPI · Sales

Customer retention rate: formula and example.

Customer retention rate is the percentage of customers you keep over a period. You take the customers at the start of the period and check how many are still customers at the end, without counting new ones. Because winning new customers usually costs more than keeping existing ones, retention is a core KPI for sustainable growth.

Customer retention rate formula

(Customers at end of period − new customers during period) ÷ customers at start of period × 100%

Worked example

Acme Groothandel had 320 active customers in 2024. In 2025 it had 350 active customers, 70 of whom were new. Customer retention rate for 2025 is (350 − 70) ÷ 320 × 100% = 87.5%.

Fictitious figures for Acme Groothandel, a sample wholesaler.

How to read this KPI

A higher retention rate means fewer customers leave. Its mirror image is customer churn: with 87.5% retention, churn is 12.5%. Compare retention by segment, region and account manager, and with previous years; also look at the revenue of the customers who left.

Pitfalls with customer retention rate

  • Counting new customers in the numerator, which pushes retention above reality.
  • Having no definition of active in wholesale, where customers without a contract never formally cancel.
  • Choosing too short a period, so customers who order once a year wrongly count as lost.

SQL & DAX

Calculating customer retention rate in SQL and DAX

Two examples on a fictitious data warehouse for Acme Groothandel: a PostgreSQL query and a measure for a Power BI model. Adjust table and column names to your own model.

SQL · PostgreSQL
WITH active AS (
  SELECT DISTINCT customer_id, date_trunc('year', order_date) AS year
  FROM orders WHERE status <> 'cancelled')
SELECT p.year + interval '1 year' AS year,
       COUNT(*) AS customers_at_start,
       COUNT(c.customer_id) AS retained_customers,
       ROUND(100.0 * COUNT(c.customer_id) / NULLIF(COUNT(*), 0), 1) AS retention_pct
FROM active p
LEFT JOIN active c
  ON c.customer_id = p.customer_id AND c.year = p.year + interval '1 year'
WHERE p.year < date_trunc('year', current_date) - interval '1 year'
GROUP BY p.year
ORDER BY 1;
DAX · Power BI
Retained Customers =
COUNTROWS(
    FILTER(
        VALUES(Sales[CustomerId]),
        CALCULATE(COUNTROWS(Sales), DATEADD('Date'[Date], -1, YEAR)) > 0
    )
)

Customer Retention % =
DIVIDE([Retained Customers], CALCULATE(DISTINCTCOUNT(Sales[CustomerId]), DATEADD('Date'[Date], -1, YEAR)))

In ENABLE

Tracking this KPI in ENABLE

Plain-language questions

Ask for customer retention rate per month, customer or product in the SQL Explorer with AI. The AI writes the SQL, you see the query and run it yourself; the AI only receives metadata.

Read more →

In your Power BI dashboard

Define the KPI as a measure in your Power BI model and show it in the portal, with "Last refreshed" next to it. Access profiles and optional row-level security decide who sees which figures.

Read more →

Custom dashboards (pilot)

Add the KPI as a tile to a custom dashboard, compared with last year. The Dashboard Builder is a pilot and can be switched on per client.

Read more →

Monthly targets

With the built-in Targets app you set a target for the KPI per month, so you see actuals and target side by side.

Read more →

FAQ

Frequently asked questions

How do you calculate customer retention rate?

Subtract new customers from the number of customers at the end of the period and divide by the number at the start. With (350 − 70) ÷ 320, retention is 87.5%. Without subscriptions, use a fixed rule to decide who is active, for example at least one order per year.

What is the difference between customer retention and churn?

Customer retention rate is the percentage of customers who stay, while churn rate is the percentage who leave. For the same group and period, they add up to 100%. Subscription businesses tend to talk about churn, while wholesalers and service firms more often talk about retention.

How can you improve customer retention?

You improve retention by spotting early which customers are starting to order less and acting on it. A falling order frequency or order size is often the first sign. Give account managers an overview of customers showing that decline.

Use AI on your own data. Securely, and without the headache.

In an online demo we show how ENABLE makes your data securely available and how you build on it: describing an app in the AI Builder, plain-language questions, dashboards and APIs. And how we set it up and manage it for you.