Skip to content

First products purchased by customers

>> Download the sample (Power BI)

This sample shows the first product a customer purchased, as determined by their first purchase date.

First Product Purchased =
MAXX (
TOPN (
1,
SUMMARIZE ( Sales_Table, Calendar_Table[Date], Products_Table[Products] ),
CALCULATE ( MIN ( Calendar_Table[Date] ) ), ASC
),
Products_Table[Products]
)
Total Sales =
SUMX ( Sales_Table, Sales_Table[Unit Price] * Sales_Table[Quantity] )
Calendar_Table =
GENERATE (
CALENDAR ( DATE ( 2017, 1, 1 ), DATE ( 2019, 12, 31 ) ),
VAR currentDay = [Date]
VAR Day =
DAY ( currentDay )
VAR Month =
MONTH ( currentDay )
VAR Year =
YEAR ( currentDay )
RETURN
ROW ( "Day", day, "Month", month, "Year", year )
)