Forum Discussion

molzmad's avatar
molzmad
Helper I
5 years ago
Solved

Cumulative total/Occupancy help

Hi,

I'm basically trying to figure out an occupancy calculation based on people entering/exiting a club, i'm also wanting this reset at 4am every day when the club closes. Would anyone know how to do this ?

 

Picture posted below

 

I'm Pretty new to power bi and cant seem to figure it out, thanks 🙂 

 

 

 

  • This looks great.  As for the 4am cutoff - that is easy to do - you can subtract 1/6 from the event_time value to shift the day assignment.

     

    Weekday = FORMAT('Table'[event_time]-1/6,"DDDD")
     
    You don't need any of the other calculated columns, just sum in_or_out
     

    You may want to add a weekday sort column.

    wd = WEEKDAY('Table'[event_time]-1/6,2)
     

     

4 Replies

  • Please provide sample data in usable format (not as a picture) and show the expected outcome.

  • This looks great.  As for the 4am cutoff - that is easy to do - you can subtract 1/6 from the event_time value to shift the day assignment.

     

    Weekday = FORMAT('Table'[event_time]-1/6,"DDDD")
     
    You don't need any of the other calculated columns, just sum in_or_out
     

    You may want to add a weekday sort column.

    wd = WEEKDAY('Table'[event_time]-1/6,2)
     

     

  • v-luwang-msft's avatar
    v-luwang-msft
    Community Support

    Hi molzmad ,

    Has your problem been solved, if so, please consider Accept a correct reply as the solution to help others find it.
     
    Best Regards
    Lucien