Forum Discussion
Anonymous
4 years agoNot applicable
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...
- 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]
)
Jihwan_Kim
Super User
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]
)
- Anonymous4 years agoNot applicable
Thank you so much!
Seeing it laid out so clearly, it makes helps my understanding of 'FILTER' a lot.
I had tried using 'AverageX' but clearly hadn't used the 'FILTER' correctly!
Amazing to have a solution so quickly -