I have a calculated field which contains the time difference between two dates in the format hh:mm:ss
DATETIME ( (Datediff('second', [Date_1], [Date_2])) / 86400 )
Is it possible to calculate average on this field in tableau?
create another calculated field
avg(datediff('second',[Date_1],[Date_2]) ) this will give you the average seconds
avg(datediff('second',[Date_1],[Date_2]) / 86400) this will give you the average days
or use
Avg(DATEDIFF('day',[Date_1],[Date_2]))
or
DATEDIFF('day',[Date_1],[Date_2]))
as suggested and aggregate it in your workbook
May I ask you why are you using DATETIME()?
I ask because I believe you're using it in the wrong way. Passing a number (x) as argument to DATETIME() will return the date x days after 01/01/1900. Basically it will convert Excel datetime format to Tableau datetime format.
And as this field is in datetime format, you can't sum, average or do anything like that (like it was a number)
If you want to simply store the difference between dates in days (I believe it is days, because you get seconds and divide by 86400), you can just:
DATEDIFF('day',[Date_1],[Date_2])
Now this is a number, and you can use average, sum, and all aggregations allowed to a numeric field