Forum Discussion

Collazo's avatar
Collazo
New Member
4 years ago
Solved

How to Compare Dates in a Incremental Data Set?

Hi I'm trying to make a dynamic dashboard where the user could be able to choose 2 dates from 2 different slicers.    I cannot give a model due to sensitivity but lets try to give a context   Sou...
  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi Collazo ,

     

    I suggest you to create date tables by CALENDAR() or CALENDARAUTO() function.

    Date 1 = 
    CALENDAR(MIN('Table'[Output date]),MAX('Table'[Output date]))
    Date 2 = 
    CALENDAR(MIN('Table'[Output date]),MAX('Table'[Output date]))

    Create unactive relationship between two date tables and your fact table.

    Measure 1 = 
    CALCULATE(COUNT('Table'[Project Name]),USERELATIONSHIP('Date 1'[Date],'Table'[Output date]))
    Measure 2 = 
    CALCULATE(COUNT('Table'[Project Name]),USERELATIONSHIP('Date 2'[Date],'Table'[Output date]))
    Diff = 
    ABS([Measure 1] - [Measure 2])

    Result is as below.

    Best Regards,
    Rico Zhou

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.