Forum Discussion

MatCienk's avatar
MatCienk
Regular Visitor
3 years ago
Solved

Finding common part of Dates dataset

Hello, I am looking for a solution for showing the collision of dates for the resource usage. So I have a table with start date column, finish date column and a resource. I would like to show some...
  • BA_Pete's avatar
    3 years ago

    Hi MatCienk ,

     

    The quickest way I can think to do this within a Direct Query model would be to create a count-over-time measure against your table, using a disconnected calendar table, something like this:

     

    _overlapCount = 
    VAR __cDate = MAX(calendar[date])
    RETURN
    CALCULATE(
        COUNT(aTable[resource]),
        KEEPFILTERS(__cDate >= aTable[startDate]),
        KEEPFILTERS(__cDate <= aTable[finishDate])
    )

     

     

    You can then put aTable[resource], calendar[date], and [_overlapCount] into a table and filter the table on [_overlapCount] > 1, like this:

     

    Pete