Forum Discussion

Yamabushi's avatar
Yamabushi
Helper I
7 years ago
Solved

Dynamic DATEDIFF problem

Hello,   I am trying to calculate the date difference between various rows in minutes as follows: I need to know the date difference between transactions for each person individually. If two o...
  • v-frfei-msft's avatar
    v-frfei-msft
    7 years ago

    Hi Yamabushi ,

     

    To use this formula to create a calcualted column.

     

    Column 2 = 
    VAR ind = Table1[Index] - 1
    VAR pre =
        CALCULATE (
            MAX ( 'Table1'[Date and time of transaction] ),
            FILTER ( Table1, Table1[Index] = ind )
        )
    RETURN
        DATEDIFF ( pre, 'Table1'[Date and time of transaction], MINUTE )
    

     

    Regards,

    Frank