Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Average occupancy by location, between two dates

Hi there,  I have a need to calculate the average occupancy of event locations for each event. I've tried varying combinations of 'CALCULATE', 'FILTER', 'DATESBETWEEN' and have spent a few hours tr...
  • Jihwan_Kim's avatar
    4 years ago

     

    Avg Occupancy CC =
    AVERAGEX (
    FILTER (
    TableA,
    TableA[Location] = TableB[Location]
    && TableA[Date] >= TableB[Start Date]
    && TableA[Date] <= TableB[End Date]
    ),
    TableA[Occupancy]
    )

     

     

    Link to the sample pbix file