Forum Discussion
Yamabushi
7 years agoHelper I
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...
- 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
Yamabushi
7 years agoHelper I
Hi v-frfei-msft,
If I have 2 transactions at the same time, I would like the first transaction to show the difference from the previous transaction (as it was at a different time). The next transaction (which is at the same time as the previous transaction), should show 0.
So the solution is not quite what I'm looking for yet. I want the second row to show 1535 and the third row to show 0.
Hope this is not too complicated.
Best regards
v-frfei-msft
7 years agoCommunity Support
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
- Yamabushi7 years agoHelper I