Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Helper I
Helper I

DAX to Calculate Room Utilization by Hour and Day

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)











Super User
Super User

@seanguerrero , change var _occupied  like this and try


var _occupied =
Sumx( addcolumns( summarize( 'Source', 'Source'[Guest], source[Date] ) , "_1", calculate(COUNT('Source'[Guest]),
'Source'[In]<=MAX('Table Time'[Time])&&'Source'[Out]>=MAX('Table Time'[Time])&&'Source'[Date]=MAX('Table Calendar'[Date])))), [_1])

Thanks for the reply @amitchandak. I changed var _occupied per your recommendation. After charting Source[Date] and Table Time[Time], I'm getting zeros. Any help would be greatly appreciated! Thanks again!





Helpful resources

PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors