Forum Discussion
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
- lbendlin
Super User
To report on things that are not there you need to use disconnected tables and/or crossjoins
Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216
Please show the expected outcome based on the sample data you provided.
https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523