Forum Discussion

Yuiitsu's avatar
Yuiitsu
Icon for Helper V rankHelper V
3 years ago

DAX function to calculate lost customer

Hi all

I want to know for certain product which customer have we lost. but I do not know how to continue my DAX formula.

Lost = no purchase history for this product for more than 2 months from today's date. 

If lost it should return as lost

If not lost it should return as current

 

Lost Customer =
VAR MaxDate =
CALCULATE( // the last sale date
MAX( 'FIN'[Sales Month] ), // the maximum sales date
ALLEXCEPT(
'FIN',
'FIN'[Customer Name],'FIN'[Product Code] // ignoring all filters but customerkey and product code

 

The end table should show customer name, Status (Lost or current) and last purchase date.

can anyone guide me what is the next step?

1 Reply