Forum Discussion
Lost Customers - Issues with DAX Calculation
- 10 years ago
Good point - you have to remove some filter from the CustomerLostDate column expression.
Try this one replacing the ADDCOLUMNS in original formula:
ADDCOLUMNS ( CALCULATETABLE ( VALUES ( Customer[CustomerCode] ), Sales ), "CustomerLostDate", CALCULATE ( MAX ( Sales[Invoice Date] ), ALLEXCEPT ( Customer, Customer[CustomerCode] ) ) + [Lost Days Limit] )
Good point - you have to remove some filter from the CustomerLostDate column expression.
Try this one replacing the ADDCOLUMNS in original formula:
ADDCOLUMNS (
CALCULATETABLE ( VALUES ( Customer[CustomerCode] ), Sales ),
"CustomerLostDate", CALCULATE (
MAX ( Sales[Invoice Date] ),
ALLEXCEPT ( Customer, Customer[CustomerCode] )
)
+ [Lost Days Limit]
)This is a great calc. The problem Im having is that its counting a customer as lost that didnt buy for 12 consecutive months more than once in their 5 year history. Only the last 12 months with no sales shoudl be counted as lost. How do I get it to only grab the last purchase date. Wehn I wabt to displayit by month it shows as lost in prior years. thanks
- marcorusso4 years agoMost Valuable Professional
There is a new version of the pattern that considers new, lost, and recovered customers - it is more flexible and you should be able to adapt it to your requirements: