Forum Discussion
EvertonRamone
8 years agoHelper I
DAX - Customer first purchase
I need a measure wich returns me the first purchase of customers who bought product B (key product 2) This is my data model FactSales KeyDate KeyCustomer KeyProduct Total ...
- 8 years ago
Hi EvertonRamone,
Create a measure using DAX as below:
Result = VAR KeyDate = CALCULATE(MIN('Calendar'[KeyDate]), FILTER('Calendar', 'Calendar'[Date] = MIN('Calendar'[Date]))) VAR KeyProduct = CALCULATE(MIN('Product'[KeyProduct]), FILTER('Product', 'Product'[Product] = "B")) RETURN CALCULATE(MIN('Customer'[Name]), FILTER('FactSales', 'FactSales'[KeyDate] = KeyDate && FactSales[KeyProduct] = KeyProduct))Regards,
Jimmy Tao
EvertonRamone
8 years agoHelper I
v-yuta-msft, Maybe I expressed myself wrong.
I meant I need to now every date of first purchase by customer
Customer A - 20/01/2018
Customer B - 14/01/2018
Customer C- 22/01/2018