Forum Discussion

fetster's avatar
fetster
Frequent Visitor
5 years ago
Solved

Calculating Duration Between In / Out Times

Hi. I have a table that has the following data:   TicketID Status Time 201 In 09:55 202 In 10:02 203 In 10:23 204 In 10:35 201 Out 10:49 205 In 10:53 206 In ...
  • Jihwan_Kim's avatar
    5 years ago

    Hi, fetster 

    Please check the below picture and the sample pbix file's link down below.

     

     

    duration measure =
    VAR intime =
    CALCULATE ( MAX ( 'Table'[Time] ), 'Table'[Status] = "In" )
    VAR outtime =
    CALCULATE ( MAX ( 'Table'[Time] ), 'Table'[Status] = "Out" )
    VAR durations = outtime - intime
    RETURN
    IF ( ISFILTERED ( 'Table'[TicketID] ), durations )
     
     

    Hi, My name is Jihwan Kim.


    If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.


    Linkedin: linkedin.com/in/jihwankim1975/

    Twitter: twitter.com/Jihwan_JHKIM