Forum Discussion

SEunson's avatar
SEunson
Frequent Visitor
4 years ago
Solved

Conditional Sum - Two Unrelated Tables

Hello,   I have two unrelated tables. In Table A I have a date column and I could like to add a calculated colum which sums up Work Hours in Table B, depending on a condition. For each row in Ta...
  • tamerj1's avatar
    4 years ago

    Hi SEunson 

    you may try 

    Hours =
    VAR CurrentDate = TableA[Date]
    RETURN
        SUMX (
            'Table B',
            IF (
                TableB[Start Date] < CurrentDate
                    && TableB[Finish Date] > CurrentDate,
                TableB[Work Hours]
            )
        )