Skip to content
All articles
CRM & Customer Intelligence

RFM Segmentation: A Practical Starting Point for Customer Intelligence

Before reaching for complex models, Recency, Frequency and Monetary analysis gives CRM teams an explainable, actionable view of customer value.

Illyas Abdulla 1 min read

Draft — this article is a work in progress and may change before publication.

Customer segmentation is one of those topics where it's tempting to jump straight to clustering algorithms. In practice, one of the most useful starting points is also one of the simplest: RFM — Recency, Frequency and Monetary value.

The three questions

  1. Recency — how recently did the customer buy?
  2. Frequency — how often do they buy?
  3. Monetary — how much do they spend?

Each customer gets a score on each dimension, usually by ranking them into bands. Combining the scores produces segments that marketing teams instantly understand: loyal high-value customers, promising new customers, customers who are drifting away, and those who have already lapsed.

Why it works

RFM is explainable. A CRM manager can look at a segment and immediately see why a customer belongs there. That makes it much easier to agree on actions — a win-back offer, a loyalty reward, an onboarding journey — than with a black-box model.

Building it at scale

With PySpark and SQL, RFM features can be calculated across the full transaction history and refreshed on a schedule. Publishing the segments to Power BI lets teams explore them, size campaigns and track how customers move between segments over time.

pythonfrom pyspark.sql import functions as F

rfm = (
    transactions
    .groupBy("customer_id")
    .agg(
        F.datediff(F.current_date(), F.max("order_date")).alias("recency_days"),
        F.countDistinct("order_id").alias("frequency"),
        F.sum("net_amount").alias("monetary"),
    )
)

Where to go next

Once RFM is in place, it becomes a foundation for more advanced work: churn prediction, lifetime value modelling, recommendation engines, and — increasingly — using language models to describe segments and suggest actions in plain language.

  • #RFM
  • #Segmentation
  • #CRM