Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
8 years ago
Solved

Counting with a date slicer

Hello everyone,   I'm building a dashboard that is supposed to give information about absentism and sick leaves in a company, but a problem arose: I would like to be able to calculate how many p...
  • MFelix's avatar
    8 years ago

    Hi Anonymous,

     

    Create a Dimesion date table and then add the following measure:

     

    Sick_Leave_Count =
    VAR start_date =
        MIN ( DimDate[Date] )
    RETURN
        CALCULATE (
            COUNT ( Absent[Worker] );
            FILTER (
                ALL ( Absent[Start Date]; Absent[End Date] );
                Absent[Start Date] <= start_date
                    && Absent[End Date] >= start_date
            )
        )
            + 0

     

    Regards,

    MFelix