Forum Discussion

Daniel_01's avatar
Daniel_01
New Member
2 years ago
Solved

Date Slicer that filters different date fields

I have a Date table, using CALENDARAUTO().       I need to be able to have a date slicer (between dates type) using this table that will filter 3 things: 1 - Absent days (this is a table that st...
  • Daniel_01's avatar
    2 years ago

    Meanwhile, I found a solution:

     

    I created this measure:

    dax_was_active = IF(AND(SUMX(EMP_TABLE, INT(EMP_TABLE[EMPLOYMENT_DATE_START]) - INT(MAXX(DAX_Dates, DAX_Dates[Date]))) <= 0, SUMX(EMP_TABLE, INT(EMP_TABLE[EMPLOYMENT_DATE_LEAVING]) - INT(MIN(DAX_Dates[Date]))) >= 0), "Yes", "No")
     
    Then I put this measure on the filter for the table visual, so I can filter by the "Yes". This way my table will only show the active employees during that period, and with the relation between the dax_dates table and the absences table it shows the correct number of absences per employee.
     
    This was quite simple after all, sorry for bothering you.