First purchase date per customer, whatever the date slicer says
Find the date of each customer’s very first order with MINX and RELATED, and keep it fixed when the report is filtered to a year with REMOVEFILTERS.
You will learn to
- Find the earliest sale date among a customer’s orders
- Ignore the report’s date filters with REMOVEFILTERS('Date')
- Explain why MIN('Date'[Date]) gives the wrong date
How it works
Almost every retention question starts with one fact per customer: **when did they first buy?** New or returning, cohort, time to second purchase: they all compare a date with it. The model doesn’t store it, so a measure works it out.
Two traps hide in that sentence. First, the Date table: a Customer row filters Sales, but the filter never travels on to Date, so `MIN('Date'[Date])` is simply the first day of the period for everyone. Iterate the customer’s sales instead, and look up each sale’s date: `MINX(Sales, RELATED('Date'[Date]))`.
Second, the slicer. With the report set to 2025, the earliest **visible** sale is the first purchase of 2025, not the first ever. Wrap the calculation in `CALCULATE(..., REMOVEFILTERS('Date'))` so it always looks at the customer’s whole history.
Practice it hands-on with a real data model and a live report that updates as you type.
First Order Key = CALCULATE(MIN(Sales[DateKey]), REMOVEFILTERS('Date'))