Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Calculating time between two rows in the same column

Hi,    I am trying to create a new column that displays the how many minutes have passed between each row in the [Time] Column. Basically, I just need to subtract the bottom row from the above row ...
  • nandukrishnavs's avatar
    nandukrishnavs
    6 years ago

     ğŸ™‚Anonymous 

     

    Diff =
    VAR __Previous =
        MINX (
            FILTER (
                'Table',
                'Table'[Date] = EARLIER ( 'Table'[Date] )
                    && 'Table'[Time] > EARLIER ( 'Table'[Time] )
            ),
            'Table'[Time]
        )
    VAR __diff = __Previous - 'Table'[Time]
    RETURN
        __diff



    Did I answer your question? Mark my post as a solution!
    Appreciate with a kudos
    🙂