Forum Discussion
Calculate Retention Rate in given date window
Hello y'all,
I am stuck to calculate the retention rate for a given date range. Any help is highly appreciated.
I have a list to participants who finished there 1st screening on a particular date and now they have to come again for a follow up visit in a given date range/window. If they visit in that date range then we will mark them as "Attended on time" but if they visited out of that date range then we will mark them "Out of window". If they don't attend at all then we mark them "Lost to follow up".
This rule applies to 6 week follow up and 6 month follow up visit. See below the dataset:
I want to calculate the retention rate of how many participant attended "on time" within the date range, how many attended "out of range" and how many we "lost to follow up".
The major thing to consider here is: they have to have attend within the given date range.
| Record ID | Screnning Completed | 6week window | Appointment completed | 6 week Status | 6 month window | 6mnth Appointment completed |
| 1 | 10/4/2021 | 10/4/2021-11/15/2021 | 10/29/2021 | Attended on time | 2/21/2022-5/16/2022 | |
| 2 | 10/14/2021 | 10/14/2021-11/25/2021 | 10/26/2021 | Attended on time | 3/3/2022-5/26/2022 | |
| 3 | 10/14/2021 | 10/14/2021-11/25/2021 | 10/26/2021 | Attended on time | 3/3/2022-5/26/2022 | |
| 4 | 10/14/2021 | 10/14/2021-11/25/2021 | 11/29/2021 | Out of Window | 3/3/2022-5/26/2022 | |
| 5 | 10/14/2021 | 10/14/2021-11/25/2021 | Lost to follow up | 3/3/2022-5/26/2022 | ||
| 6 | 10/14/2021 | 10/14/2021-11/25/2021 | Lost to follow up | 3/3/2022-5/26/2022 |
Any help is highly appreciated.
Thanks.
7 Replies
- amitchandak
Super User
axarhaan , Based on what I got
a New column =
Switch(True() ,
isblank([Appointment completed]) , today() >= [Screening Completed] +42, "Lost to follow up" ,
isblank([Appointment completed]) , today() <= [Screening Completed] +42 ,"Appointment due" //You need to correct this
[Appointment completed] >= [Screening Completed] +42 , "Out of Window",
[Appointment completed] <= [Screening Completed] +42 , "Attended on Time"
)
- axarhaan
Helper I
amitchandak Thank you for your reply. I am new to power bi and still learning. I am getting an error.
Can you please explain or tell me the solution for this please or how to fix it. Thanks.
- Samarth_18
Community Champion
Hi axarhaan ,
Just small change on what Amit suggested. Try like below:-
column = Switch(True() , isblank([Appointment completed]) && today() >= [Screnning Completed] +42, "Lost to follow up" , isblank([Appointment completed]) && today() <= [Screnning Completed] +42 ,"Appointment due", [Appointment completed] >= [Screnning Completed] +42 , "Out of Window", [Appointment completed] <= [Screnning Completed] +42 , "Attended on Time" )Thanks,
Samarth
- axarhaan
Helper I
Samarth_18 Hey Samarth.... Thanks for the reply.... Yes, it worked great.... Thank you for your help.... I have 1 last question, sorry for that....
Can we differentiate those record ids as a group... like what if I want to show that record id 1 and 3 was in group 1 and record id 2 & 4 was in group 2 and so on so forth... so that I can show the graphs by groups that how many attended on time in group 1 and how many lost in that group.... something like that...
Also your solution worked to get the status of 6 week but then how to get the 6 month window... Please advice as I am new to this..
Check below the sample dataset... Your help is greatly appreciated...
Groups Record ID Screnning Completed 6week window Appointment completed 6 week Status 6 month window 6mnth Appointment completed Group 1 1 10/4/2021 10/4/2021-11/15/2021 10/29/2021 Attended on time 2/21/2022-5/16/2022 Group 2 2 10/14/2021 10/14/2021-11/25/2021 10/26/2021 Attended on time 3/3/2022-5/26/2022 Group 2 3 10/14/2021 10/14/2021-11/25/2021 10/26/2021 Attended on time 3/3/2022-5/26/2022 Group 3 4 10/14/2021 10/14/2021-11/25/2021 11/29/2021 Out of Window 3/3/2022-5/26/2022 Group 1 5 10/14/2021 10/14/2021-11/25/2021 Lost to follow up 3/3/2022-5/26/2022 Group 3 6 10/14/2021 10/14/2021-11/25/2021 Lost to follow up 3/3/2022-5/26/2022 - Samarth_18
Community Champion
axarhaan , Could you please share the condition on what basis grouping need to done?
- axarhaan
Helper I
Samarth_18 The idea behind grouping is to see the retention rate of each group... like in each group there are 10 participants and we need to compare which group has highest retention rate or appointment attendence rate and the lowest retention rate... its like to keep a track of participants who are attending and not attending by group....