Forum Discussion
RichardT_78
5 years agoHelper I
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...
- Anonymous5 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 ) + 0Best regards
amitchandak
5 years agoSuper User
RichardT_78 ,The information you have provided is not making the problem clear to me. Can you please explain with an example.
Appreciate your Kudos.
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.