DAX code
Active Customers (Last 90 Days) =
VAR LastDate = MAX('Date'[Date])
RETURN
CALCULATE(
DISTINCTCOUNT('Sales'[CustomerID]),
DATESINPERIOD('Date'[Date], LastDate, -90, DAY),
ALL('Date')
)
Counts distinct customers who made at least one purchase in the trailing 90 days.
Type your table and column names once. Every measure below updates.
Active Customers (Last 90 Days) =
VAR LastDate = MAX('Date'[Date])
RETURN
CALCULATE(
DISTINCTCOUNT('Sales'[CustomerID]),
DATESINPERIOD('Date'[Date], LastDate, -90, DAY),
ALL('Date')
)
ALL('Date') anchors the 90-day window to the last loaded date rather than whatever date filter is active.
Browse all 175 measures in the Power BI DAX Measures Library, or search the library for something similar to Active Customers (Last 90 Days).