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
kevinWH
Regular Visitor

DAX for customer lost and reactivated

Hi,

I am new to Power BI and need help on DAX for two of my formulas in excel sheet.

I have created a mock data with formulas for lost_date and reactivated_date for a customer.

 

Lost reactive customer.JPG

 

Link to download the excel worksheet.

 

http://www.filedropper.com/lostandreactivatedcustomer

 

Thanks,

Kevin

6 REPLIES 6
kevinWH
Regular Visitor

Sorry. There was a mistake in the excel sheet. Attaching the corrected version

 

Lost reactive customer (1).JPG

 

Link to download the excel sheet:

http://www.filedropper.com/lostandreactivatedcustomer1

Baskar
Resident Rockstar
Resident Rockstar

@kevinWH  let me know what the expected result from your formula. can you please tell me the logic.

Hi Baskar,

 

The results are the lost and reactivate column present in the excel file . link to download the file is attached below. Logic is shared in one of my previous replies. 

 

http://www.filedropper.com/lostandreactivatedcustomer1

 

Regards,

Kevin

EnsFlynn
Frequent Visitor

Could you provide some context on what the formulas are doing and why?

Hi Flynn,

Where you able to find a solution for this problem?

 

Thanks,

Kevin

Hi,

 

I am finding the date when a customer is lost and reactivated.

 

1) Multiple visit scenario:

   A) Lost in the middle and reactivated

       A customer is considered lost if he/she has not visited for more than 18 months. this is found by finding the difference between   any two consecutive visits is more than 18 months ( or 548 days). The lost date is calculated by adding  548 days to he earlier of     the two consecutive days.  The later of the two days is considered as the reactived date.  Example : customer_id 4 in the excel that I have shared. 

 

    B)Lost at the end:

       The customer had multiple visits. The date difference between any two visists were not more that 548 days so the customer was active for the whole time but since his last visit it has been more than 548 days when compared to today. In this case the customer was lost by adding 548 days to his last visit date. Example : customer_id 1 in the excel that I have shared. This customer will not have a reactived date

 

2) Single visit scenario:

If the customer visited only once that we compare the visit date to today's date and find if it is more than 548 days . If it is more than 548 days then we add 548 days to the visit date and call it as his lost date. Example : Customer_id 6 in the excel that I have shared

 

Hope this helps 

Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.