Forum Discussion

Hgsilva's avatar
Hgsilva
Frequent Visitor
9 months ago
Solved

Utilization Rate

Good afternoon,   I'm have trouble building a formula for utilization of rooms in a building. Each room is alloted 600 minutes a day, monday through friday. I have two collumns that added together ...
  • Praful_Potphode's avatar
    Praful_Potphode
    9 months ago

    Hi Hgsilva 

    to create this we will have to multiple calculated columns and measures.

    Step 1: Create Calendar table and create realtionship between Calendar table and Roomdata(sample data) table.

    Date=CalendarAuto()

    Step 2: Create calculated columns for surgery minutes,patient minutes,cleanup minutes and total event minutes

    Surg Minutes =
    DATEDIFF(
        'RoomData'[SurgStartDateTime],
        'RoomData'[SurgEndDateTime],
        MINUTE
    )
    Patient Minutes =
    DATEDIFF(
        'RoomData'[Patient-InRoomDateTime],
        'RoomData'[Patient-OutRoom DateTime],
        MINUTE
    )
    Cleanup Minutes =
    DATEDIFF(
        'RoomData'[Room-CleanUpStartDateTime],
        'RoomData'[Room-CleanUpStopDateTime],
        MINUTE
    )
    Total Event Minutes Used =
    'RoomData'[Patient Minutes] + 'RoomData'[Cleanup Minutes]

     Step 3: Create Base Measure for Total Minutes

    Total Minutes Used =
    SUM( 'RoomData'[Total Event Minutes Used] )

    Step 4:  Calculate Total Alloted Minutes Used

    Total Allotted Minutes =
    VAR AllottedPerDay = 600
    VAR WorkingDays =
        CALCULATETABLE(
            VALUES('Date'[Date]), -- Assumes your Date Table is named 'Date'
            WEEKDAY('Date'[Date], 2) <= 5  -- Filter for Monday (1) through Friday (5)
        )
    VAR WorkingDaysCount = COUNTROWS( WorkingDays )
    RETURN
        WorkingDaysCount * AllottedPerDay

    Step 5: Create Utilization Percentage

    Room Utilization % =
    DIVIDE(
        [Total Minutes Used],
        [Total Allotted Minutes]
    )

     

    Now customize the logic as per the business requirements in above calculation.

     

    Please give kudos or mark it as solution once confirmed.

     

    Thanks and Regards,

    Praful