Forum Discussion

JC2022's avatar
JC2022
Helper III
3 years ago
Solved

Sum if value is between two dates

Hi, I want to calculate the hours for each employee on each day (and sum these per period). First I need to check the Schedule ID per Employee ID on each day, because this can change over time (as ...
  • tamerj1's avatar
    tamerj1
    3 years ago

    JC2022 
    Please try

    =
    SUMX (
        Schedule,
        SUMX (
            FILTER (
                Hours,
                Hours[Schedule ID] = Schedule[Schedule ID]
                    && Hours[Date] >= Schedule[From Date]
                    && Hours[Date] <= Schedule[To Date]
            ),
            Schedule[Hours]
        )
    )