Forum Discussion

hassanh2's avatar
hassanh2
Helper I
1 year ago
Solved

Staff Log Tracker

Hello, Im trying to design a visual that can highlight the following scenarios. the data set is for a clinic where they perform surgical procedures, nurses are required to Sigin/out from each proce...
  • v-dineshya's avatar
    1 year ago

    Hi hassanh2 ,

    Thank you for reaching out to the Microsoft Community Forum.

     

    Please follow below steps:

    1. Table Visual with Conditional Formatting
    Use a table to display all log entries with columns: Staff Name, OR Room, IN OR, OUT OR and Conflict Flag (new field)

    And use conditional formatting to highlight rows where there is a time conflict.

    Create a calculated column or measure to flag the overlap.

    ConflictFlag =
    VAR CurrentStaff = 'Logs'[Staff Name]
    VAR CurrentIn = 'Logs'[IN OR]
    VAR CurrentOut = 'Logs'[OUT OR]
    VAR Overlaps =
    CALCULATE(
    COUNTROWS('Logs'),
    FILTER(
    'Logs',
    'Logs'[Staff Name] = CurrentStaff &&
    'Logs'[IN OR] < CurrentOut &&
    'Logs'[OUT OR] > CurrentIn &&
    'Logs'[Log ID] <> EARLIER('Logs'[Log ID])
    )
    )
    RETURN IF(Overlaps > 0, "Conflict", "OK")

    Use conditional formatting in the table visual to color rows: Red: if ConflictFlag = "Conflict" and
    Green: if ConflictFlag = "OK"

    You can even add arrows or icons using Unicode symbols or Power BI icons to make it more visually intuitive (like the ones in your image).

    Note:

    Other Visuals: Timeline Chart / Gantt: If you want to visualize a nurse’s presence in the ORs over time, a Gantt chart (with staff on the Y-axis and time on the X-axis) can show overlaps clearly.

    Matrix View: Staff vs. OR Room vs. Time Blocks. Highlight time overlaps.

     

    If my response has resolved your query, please mark it as the Accepted Solution to assist others. Additionally, a 'Kudos' would be appreciated if you found my response helpful.

    Thank you

  • HarishKM's avatar
    HarishKM
    1 year ago

    hassanh2 Hey,
    Copy paste this same measure only  but as calculated column.

     

    MissingSignOutFlag =
    VAR CurrentNurse = [NurseID] -- Assumed Nurse ID or Name column
    VAR CurrentStartTime = [SignInTime] -- Assumed column for Sign-In time
    VAR PreviousSignOutTime =
    CALCULATE(
    MAX('ProcedureLog'[SignOutTime]),
    FILTER(
    'ProcedureLog',
    'ProcedureLog'[NurseID] = CurrentNurse &&
    'ProcedureLog'[SignOutTime] < CurrentStartTime
    )
    )
    RETURN
    IF(
    ISBLANK(PreviousSignOutTime),
    1, -- Flag as missing sign out (overlap)
    0 -- No overlap
    )