Customers retained from last year with INTERSECT

Count the customers who bought in the same period last year and again in this one (a month, a quarter or a year), by intersecting two customer lists that follow the date filter.

You will learn to

  • Build a list of customers for another period with CALCULATETABLE
  • Keep only the customers that appear in both lists with INTERSECT
  • Count a virtual table with COUNTROWS

How it works

`[Customers]` and `[Customers LY]` are counts, and counts can’t tell you **who** overlaps. March 2025 had 26 buyers and March 2024 had 16, but that doesn’t say how many of the 16 came back. For that you need the lists themselves.

`VALUES(Sales[CustomerKey])` is the list of customers who bought in the current context. `CALCULATETABLE(VALUES(Sales[CustomerKey]), SAMEPERIODLASTYEAR('Date'[Date]))` is the same list for the same period a year earlier.

`INTERSECT(table1, table2)` keeps the rows that are in **both** tables, and `COUNTROWS` counts them. Take the keys from `Sales`, not from `Customer`: the Customer table isn’t filtered by dates, so its list would hold every customer.

Practice it hands-on with a real data model and a live report that updates as you type.

Customers Buying Bikes and Clothing =
COUNTROWS(INTERSECT(
    CALCULATETABLE(VALUES(Sales[CustomerKey]), Product[Category] = "Bikes"),
    CALCULATETABLE(VALUES(Sales[CustomerKey]), Product[Category] = "Clothing")))