Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Help needed: Sum values based on date checking, two related tables.

I have two tables, joined on location. I need to determine what the daily budget hours from the LocationBudget table based on the location and date in the LocationCalendar table.   What I'm trying ...
  • mahoneypat's avatar
    5 years ago

    Here is a column expression that should get your desired result.

     

    Daily Hours =
    VAR thisdate = LocationCalendar[Date]
    RETURN
        CALCULATE (
            MIN ( LocationBudget[BudgetHours] ),
            LocationBudget[BudgetStart] <= thisdate,
            LocationBudget[BudgetEnd] >= thisdate
        )

     

    Regards,

    Pat