Forum Discussion
Calculating Average Occupancy Between Times
- 4 years ago
Hi datbrink ,
per room per day.
I think you are only counting the number of occurrences of this room within these dates. If you want to calculate the average, how many days are there within these dates.
Total number of occurrences / total number of days
Measure :
Room_Counter = DIVIDE( COUNTROWS( FILTER( RawData, RawData[Start Time] <= SELECTEDVALUE( 'DateTime Table'[Datetime] ) && SELECTEDVALUE( 'DateTime Table'[Datetime] ) <= RawData[Stop Time] ) ), COUNTROWS( VALUES( RawData[Start Date] ) ) )Pbix file in the end.
Best Regards
Community Support Team _ chenwu zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Alexis,
Here is a link to the file. Please let me know if you have any questions or concerns.
https://drive.google.com/file/d/1gvQvYLKHba0dMHh5oQy-sN-he9-A6iIj/view?usp=sharing
Hi datbrink ,
per room per day.
I think you are only counting the number of occurrences of this room within these dates. If you want to calculate the average, how many days are there within these dates.
Total number of occurrences / total number of days
Measure :
Room_Counter =
DIVIDE(
COUNTROWS(
FILTER(
RawData,
RawData[Start Time] <= SELECTEDVALUE( 'DateTime Table'[Datetime] )
&& SELECTEDVALUE( 'DateTime Table'[Datetime] ) <= RawData[Stop Time]
)
),
COUNTROWS( VALUES( RawData[Start Date] ) )
)
Pbix file in the end.
Best Regards
Community Support Team _ chenwu zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.