Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Yuiitsu
Helper V
Helper V

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 1
lbendlin
Super User
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-...
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

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.