Forum Discussion
ConfusedTime
3 years agoFrequent Visitor
Overlapping Dates and Service Type
Hi Everyone, I'm after some help if possible, I've been through previous posts and I'm stuck! I'm trying to identify an overlap in services by date and service type, so for example this woul...
- Anonymous3 years ago
Hi ConfusedTime ,
You can create a calculated column as below to get it:
Flag = CALCULATE ( DISTINCTCOUNT ( 'Service'[Service] ), FILTER ( 'Service', [ClientID] = EARLIER ( [ClientID] ) && 'Service'[Start Date] > EARLIER ( 'Service'[Start Date] ) && 'Service'[Start Date] <= EARLIER ( 'Service'[End Date] ) && 'Service'[Service] <> EARLIER ( 'Service'[Service] ) ) )Best Regards
ConfusedTime
3 years agoFrequent Visitor
Thanks for your reply. I'm hoping to be able to give a count of overlaps, plus identify who they are so they can be followed up.
I've attached a sample of data, in this example it would highlight 4 overlaps of service (highlighted blue).
Thanks for all your help!
| ClientID | Service | Start Date | End Date |
| 11111 | Service A | 18/11/2018 | 26/11/2018 |
| 11111 | Service A | 11/05/2019 | |
| 11111 | Service A | 19/06/2021 | 10/07/2021 |
| 11131 | Service A | 27/12/2016 | 16/06/2017 |
| 11131 | Service B | 13/06/2017 | 23/09/2017 |
| 11131 | Service A | 24/09/2017 | 21/07/2018 |
| 11131 | Service A | 22/07/2018 | 02/10/2018 |
| 11131 | Service A | 14/12/2020 | 04/01/2021 |
| 11131 | Service A | 03/01/2021 | |
| 11222 | Service A | 10/08/2013 | 24/11/2013 |
| 11222 | Service A | 10/08/2013 | 06/04/2014 |
| 11222 | Service A | 21/11/2013 | 06/04/2014 |
| 11222 | Service B | 07/04/2014 | 17/02/2015 |
| 18888 | Service A | 11/04/2011 | 09/03/2014 |
| 18888 | Service A | 10/03/2014 | 17/08/2014 |
| 26262 | Service A | 16/09/2013 | 11/10/2013 |
| 26262 | Service B | 12/10/2020 | 20/10/2020 |
| 26262 | Service A | 18/10/2020 | 01/11/2020 |
| 91919 | Service A | 18/03/2013 | 02/09/2013 |
| 91919 | Service A | 07/04/2014 | 12/10/2016 |
| 91919 | Service B | 10/10/2016 | |
| 99991 | Service A | 24/10/2019 | |
| 99991 | Service A | 07/12/2020 | 25/06/2021 |
| 99991 | Service B | 25/06/2021 | 02/07/2021 |
| 99991 | Service A | 03/07/2021 | 14/09/2021 |
| 99991 | Service A | 26/01/2022 | 14/09/2022 |
Anonymous
3 years agoNot applicable
Hi ConfusedTime ,
You can create a calculated column as below to get it:
Flag =
CALCULATE (
DISTINCTCOUNT ( 'Service'[Service] ),
FILTER (
'Service',
[ClientID] = EARLIER ( [ClientID] )
&& 'Service'[Start Date] > EARLIER ( 'Service'[Start Date] )
&& 'Service'[Start Date] <= EARLIER ( 'Service'[End Date] )
&& 'Service'[Service] <> EARLIER ( 'Service'[Service] )
)
)
Best Regards
- ConfusedTime3 years agoFrequent Visitor
This works perfectly! Thank you so much for all you help! 😊