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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
keylian031987
Regular Visitor

Overlapping Data

Hi,

 

I have this table and I want to identify if the backup employee have the same vacation dates. Any help?

 

keylian031987_0-1662734654299.png

 The data is from a Power App that I have created, I have the employee number too. I had tried many things but nothing works.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @keylian031987 ,

 

Please try this column:

Column = 
VAR _start_date1 = 'Table'[Start Date]
VAR _employee = 'Table'[Employee Backup]
VAR _start_date2 =
    CALCULATE (
        MIN ( 'Table'[Start Date] ),
        FILTER ( ALL ( 'Table' ), 'Table'[Employee Name] = _employee )
    )
VAR _end_date1 = 'Table'[End Date]
VAR _end_date2 =
    CALCULATE (
        MAX ( 'Table'[End Date] ),
        FILTER ( ALL ( 'Table' ), 'Table'[Employee Name] = _employee )
    )
VAR _result =
    IF (
        OR (
            AND ( _start_date2 >= _start_date1, _start_date2 <= _end_date1 ),
            AND ( _end_date2 >= _start_date1, _end_date2 <= _end_date1 )
        ),
        "Overlapping",
        "Non Overlapping"
    )
RETURN
    _result

vcgaomsft_0-1663060073356.png

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly -- How to provide sample data

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi @keylian031987 ,

 

Please try this column:

Column = 
VAR _start_date1 = 'Table'[Start Date]
VAR _employee = 'Table'[Employee Backup]
VAR _start_date2 =
    CALCULATE (
        MIN ( 'Table'[Start Date] ),
        FILTER ( ALL ( 'Table' ), 'Table'[Employee Name] = _employee )
    )
VAR _end_date1 = 'Table'[End Date]
VAR _end_date2 =
    CALCULATE (
        MAX ( 'Table'[End Date] ),
        FILTER ( ALL ( 'Table' ), 'Table'[Employee Name] = _employee )
    )
VAR _result =
    IF (
        OR (
            AND ( _start_date2 >= _start_date1, _start_date2 <= _end_date1 ),
            AND ( _end_date2 >= _start_date1, _end_date2 <= _end_date1 )
        ),
        "Overlapping",
        "Non Overlapping"
    )
RETURN
    _result

vcgaomsft_0-1663060073356.png

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly -- How to provide sample data

God! Thank You! This worked perfectly!

Natalie_iTalent
Administrator
Administrator

Hello @keylian031987,

I am sending you a private message about this post.

 

Best,

Natalie H.

Community Manager 

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.