Are you looking for below?
I created a data item for this. Lookup function gives you value in values in the specified row.
I am also attaching packaged workbook in tableau 10.4
DATEDIFF('minute', LOOKUP(ATTR([date and time] ),-1) ,attr([date and time]))
packaged workbook.twbx 45.8 KB
Thanks for your response. I think this might solve my problem but is there any chance you could provide your packaged workbook in version 10.3 or earlier. Unfortunately I can't open 10.4 and would like to see how you have calculated the 'pre date time' etc?
Also does the data need to be sorted by site number for this formula to work?
thanks this is great