Forum Discussion

RichardT_78's avatar
RichardT_78
Helper I
5 years ago
Solved

Time

Hi  I have used this code to determine the time difference between rows as a messure.    This looks at each row of data.    Time Difference Measure13 = VAR NextRow = CALCULATE ( MIN ( FAC[S...
  • Anonymous's avatar
    Anonymous
    5 years ago

    Hello @RichardT_78 ,

    You can update your measurement as below screenshot shown, please find more details in the attachment:

    Time Difference = 
    VAR _nexindex =
        CALCULATE (
            MIN ( 'FAC'[Index] ),
            FILTER (
                ALLEXCEPT ( 'FAC', 'FAC'[Consist] ),
                'FAC'[Index] > MAX ( 'FAC'[Index] )
            )
        )
    VAR _nexttime =
        CALCULATE (
            MAX ( 'FAC'[Start Date/Time] ),
            FILTER ( ALLEXCEPT ( 'FAC', 'FAC'[Consist] ), 'FAC'[Index] = _nexindex )
        )
    RETURN
        DATEDIFF ( SELECTEDVALUE ( 'FAC'[Start Date/Time] ), _nexttime, SECOND ) + 0

    Time.JPG

    Best regards