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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
datahustle
Frequent Visitor

Calculating drop off clients

I have a table that has client data in it and i'm trying to calculate retention for each month. The problem is this: 

 

i have someone named Sarah. her first visit was on 2/28/2024. That was also her last visit. in order to identify when Sarah 'dropped off' as a client, I add 45 days to the last session. So 2/28 + 45 days would be 4/13/2024. 

 

I have 2 date fields. one that shows each session date that a client arrives for. the other is the dropoff date. So if i want to look at February stats (by filtering on session date for february), I would see that Sarah is a new client, because her first session was in February and she hasn't yet dropped off until that 45 day threshold kicks in.  But when I set the session date filter to April, because she only has 1 record in february, and never returned, she doesn't show up as a drop-off.  the 4/13 date is in the dropoff date field, not session date.

One idea i had was to add an artificial row for each client who's dropped off under session date that would act as their dropoff date but i don't think that's the best way to set it up. 

 

Any ideas? Attached is an example of what i'm seeing: 

datahustle_0-1721418222331.png

 

This is the current measure I'm using: 

Dropped_Off_Clients =
CALCULATE(
    DISTINCTCOUNT('Sheet1'[patient_number]),
    'Sheet1'[Is_Dropped_Off] = 1
)

 



 

1 ACCEPTED SOLUTION

Hi,

Create a Calendar Table with calculated column formulas for Year, Month name and Month number.  Sort the Month name by the Month number.  Create a relationship (Many to One and Single) from "last_session_datedropoff_threshold" column to the Date column of the Calendar Table.  To your visual, drag the Year and Month name column from the Calendar Table.  Write this measure

Dropped off clients = DISTINCTCOUNT('Sheet1'[patient_number])

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

6 REPLIES 6
datahustle
Frequent Visitor

here's some sample data:

datahustle_0-1721927505474.png

 

In terms of expected output, i would want to see drop-offs by month (month being departure date)

datahustle_1-1721928022818.png

 

I cannot do much with an image.  Share data in a format that can be pasted in an MS Excel file.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

i keep trying to copy/paste the sheet in here but i get the following error: 

Your post has been changed because invalid HTML was found in the message body. The invalid HTML has been removed. Please review the message and submit the message when you are satisfied.

treatment_typepatient_numberpatient_namestaff_member_namestatefirst_visitdrop_off_flagfirst_session_datesession_datelast_session_datelast_session_datedropoff_thresholdMonth (number)Month (name)Day of monthWeekYear
Individual Therapy162John JacksonMirandaarrivedTRUE112/27/202312/27/202312/27/20232/10/202412December27522023
Individual Therapy129Yao MingIvanaarrivedTRUE112/2/202312/2/202312/2/20231/16/202412December2 2023
Individual Therapy131Becca JohnsonMoearrivedTRUE112/5/202312/5/202312/5/20231/19/202412December5 2023
Individual Therapy138Logan WilsonMoearrivedTRUE112/5/202312/5/202312/5/20231/19/202412December5 2023
Individual Therapy151Robert PohlTatyanaarrivedTRUE112/15/202312/15/202312/15/20231/29/202412December15 2023
Individual Therapy146Shahab YaghiMirandaarrivedTRUE112/22/202312/22/202312/22/20232/5/202412December22 2023
Individual Therapy196Joe RoganTatyanaarrivedTRUE11/29/20241/29/20241/29/20243/14/20241January29 2024

Hi,

Create a Calendar Table with calculated column formulas for Year, Month name and Month number.  Sort the Month name by the Month number.  Create a relationship (Many to One and Single) from "last_session_datedropoff_threshold" column to the Date column of the Calendar Table.  To your visual, drag the Year and Month name column from the Calendar Table.  Write this measure

Dropped off clients = DISTINCTCOUNT('Sheet1'[patient_number])

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Ashish_Mathur
Super User
Super User

Hi,

Share some data to work with and show the expected result.  Share data in a format that can be pasted in an MS Excel file.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

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