Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
action316
New Member

Room utilization report, need the daily room use delay

IDDateInRoomRoomArea
19/9/20201899-12-30 08:25:18.000Room 5ED
29/9/20201899-12-30 09:28:43.000Room 5ED
39/9/20201899-12-30 10:52:50.000Room 5ED
49/9/20201899-12-30 14:14:22.000Room 5ED
59/9/20201899-12-30 08:27:11.000Room 6ED
69/9/20201899-12-30 08:34:57.000Room 6ED
79/9/20201899-12-30 09:41:37.000Room 6ED
89/9/20201899-12-30 10:58:21.000Room 6ED
99/9/20201899-12-30 14:00:11.000Room 6ED
109/10/20201899-12-30 07:43:46.000Room 5ED
119/10/20201899-12-30 08:08:03.000Room 5ED
129/10/20201899-12-30 09:52:28.000Room 5ED
139/10/20201899-12-30 12:04:18.000Room 6ED
149/10/20201899-12-30 08:03:16.000Room 6ED
159/10/20201899-12-30 10:16:13.000Room 6ED

 

Here is a snippet of my data.  What I need is the minutes delay from the Start Time of 8:00 to the room is use use, InRoom.  Need the minutes  per room, per day, that will roll up and total for day, month, year.  Here is a calculated field that works, but won't total and rollup.  SODD will be one value used to determine room utilization.

 

SODD = var FirstPatient = CALCULATE (
        MIN ( Sheet1[InRoom] ),
              FILTER (
              ALLEXCEPT ( 'Sheet1', Sheet1[Room] ),
             'Sheet1'[Date]=Max(Sheet1[Date])
)
) var SODD = DATEDIFF(time(8,0,0), FirstPatient , MINUTE ) RETURN IF (SODD > 0, SODD, 0)

 

My Results end up like this, it's giving me the minimun number instead of the totals.

 

Wednesday, September 9, 2020  |     25

     Room 5                                   |     25
     Room 6                                   |     27
Thursday, September 10, 2020    |     0
     Room 5                                   |     0
     Room 6                                   |     3

3 REPLIES 3
lbendlin
Super User
Super User

Remember that the totals work on the filter context of the entire visual data.  You use MIN() in your calculation, so you get MIN() for the totals.

 

If you want the sum then calculate the sum , even for each ID, and even if that seems overkill.

 

What do you want to do for ID 10 ? Just ignore it or use as credit?

 

Here would be the calculated column for the gap (in hours)

 

Empty = 24*(max(Occupancy[InRoom],time(8,0,0))-time(8,0,0))

 

and here are the results

lbendlin_0-1600195393187.pnglbendlin_1-1600195437710.png

etc.

 

Thanks for the response! I only want the minutes for each day and each room from 8:00 AM to the first time the room is used (InRoom).  That gives me the minutes that the room was available but not used at the begining on the day. I don’t want anything for the other times that the room was used, those can be 0 and if the first time a room is used is before 8:00 it would be 0.

@action316 , Something like this?

 

new column =

var _1  = datediff(time(8,0,0),[InRoom], minute)

return

if(_1>0,_1, 0)

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.