New customers per month: count first-time buyers
Count the customers who made their first purchase in each period by comparing a running customer count at the end and start of the period.
You will learn to
- Define a new customer as one whose first purchase falls in the period
- Capture the first and last visible dates in variables
- Build a running count with a filter on the date column
How it works
A **new customer** is one whose **first** purchase falls in the current period. Counting them shows whether the business is still winning customers, or only selling to the same ones again.
Think of a running count: how many different customers had ever bought by a given day. Take that count at the **end** of the period, subtract the count from just **before** it started, and what’s left is the customers who joined during the period.
Capture both edges first, with `VAR FirstDay = MIN('Date'[Date])` and `VAR LastDay = MAX('Date'[Date])`. A filter such as `'Date'[Date] <= LastDay` inside CALCULATE replaces the month filter with “every day up to that one”, so `[Customers]` counts everyone who had bought by then.
Practice it hands-on with a real data model and a live report that updates as you type.
Customers to Date =
VAR LastDay = MAX('Date'[Date])
RETURN CALCULATE([Customers], 'Date'[Date] <= LastDay)