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

View all the Fabric Data Days sessions on demand. View schedule

Reply
mattramirez2020
Helper II
Helper II

Leaking, Lost and Gone Dates

Hi,

 

I am trying to create a measure that totals the amount of people that were last seen 1 year (leaking), 2 years (lost) and 3 years (gone) ago. I have a customer table that has a date of last visit and I presently have everyone assigned to a present-day category just by using this measure:

 

Customer Status = SWITCH(TRUE(),'customer table'[archive]=1,"Archived",'customer table'[DSLV]=BLANK(),"Prospect",'customer table'[DSLV]<365,"Active",'customer table'[DSLV]<720,"Leaking",'customer table'[DSLV]<1095,"Lost",'customer table'[DSLV]<3650,"Gone", BLANK())

 

Max CLV = CALCULATE(Max('Appointments'[Appt Date]), 'Appointments'[Status] = "Completed")
 

This works well except for when I have a date filter on a report page. I would like to make individual date relative measures where there is a measure column for Leaking, Lost and Gone Statuses tied to the last date in the present filter (say for instance that February 2020 would determine the status dates for these people as of 2/29/20. Am I overcomplicating this? I do have an inactive relationship between my date table but can't make it primary. 

 

Customer Table:

Customer_IDMax CLV (completed last visit)DSLV (days since last visit)Customer Status
18/3/171079Lost
21/9/152016Gone
31/13/20186Active

 

Appointments Table:

Customer_IDDateStatus
11/1/15Completed
18/3/17Completed
212/18/14Completed
21/9/15Completed
311/13/19Completed
31/13/20Completed
39/2/20Not-Confirmed


Desired Output:

Three measures that count the number of active, leaking, lost and gone people dependent on the Max CLV (date of last completed visit up until the end of the filter) and the date range/last date of the currently selected filter range in the report.

 

Example:

Filter Range: Dec 2019

Active Measure: Would find the difference between 12/31/2019 and the max completed appt date up until 12/31/19. For customer 3, the MAX DLV for the Dec 2019 filter range would be 11/13/19. So for the Dec 2019 filter range, this person would exist in active because 12/31/19-11/13/19 is less than 1 year and it would assign them to an active measure.

Leaking, Lost and Gone Measures: same logic as above except it would like for spreads of 1 year to 2 years, 2 years to 3 years and then over three years.

 

If anyone could help, I would certainly appreciate it!

2 REPLIES 2
dax
Community Support
Community Support

Hi @mattramirez2020 , 

I am not clear about your requirement, if possible could you please inform me more detailed information(such as your expected output and your sample data )? Then I will help you more correctly.

Please do mask sensitive data before uploading.

Thanks for your understanding and support.
Best Regards,
Zoe Zhi

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@mattramirez2020 , refer if these can help

 

https://radacad.com/lost-customers-dax-calculation-for-power-bi

https://www.youtube.com/watch?v=cfDyNPQIJtA

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors