Forum Discussion

ConfusedTime's avatar
ConfusedTime
Frequent Visitor
3 years ago
Solved

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...
  • Anonymous's avatar
    Anonymous
    3 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