Hi PBI Community,
I'm trying to calculate hourly % utilization with a sample of the following data points. I want to display a matrix visual that shows by day and hour, the percentage of rooms occupied (similar to the last image). I found this DAX on this site but couldn't get it to calculate correctly. I also need to ensure that the appropriate utilization is calculated for the hours inbetween "In" and "Out." For instance, if 'In' is 8am and 'Out' is 10am, I need to make sure that the DAX accounts for the 9am hour.
Sorry -- new to DAX and looking to learn from the community.
Measure Utilization =
var _occupied =
'Source'[In]<=MAX('Table Time'[Time])&&'Source'[Out]>=MAX('Table Time'[Time])&&'Source'[Date]=MAX('Table Calendar'[Date])))
var _utilization =
DIVIDE(_occupied,20) // for 20 rooms
IF(_utilization = BLANK(),0,_utilization)