Forum Discussion
Total Time difference sum not working
- 1 year ago
TaroGulati , Try creating a measure using
DAX
Time Difference =
VAR TotalSeconds = DATEDIFF(MIN('Table'[Start Date]), MAX('Table'[End Date]), SECOND)
VAR Result_hour = INT(TotalSeconds / 3600)
VAR Result_minutes = INT(MOD(TotalSeconds, 3600) / 60)
VAR Result_second_final = MOD(TotalSeconds, 60)
RETURN FORMAT(Result_hour, "00") & ":" & FORMAT(Result_minutes, "00") & ":" & FORMAT(Result_second_final, "00") - 1 year ago
Hi TaroGulati ,
Update your DAX measure to look like this:
Time Difference = VAR TotalSeconds = SUMX( 'Table', DATEDIFF('Table'[Start Date], 'Table'[End Date], SECOND) ) VAR TotalHours = INT(TotalSeconds / 3600) VAR TotalMinutes = INT(MOD(TotalSeconds, 3600) / 60) VAR TotalSecondsFinal = MOD(TotalSeconds, 60) RETURN FORMAT(TotalHours, "00") & ":" & FORMAT(TotalMinutes, "00") & ":" & FORMAT(TotalSecondsFinal, "00")Your output will look like this:
TaroGulati , Try creating a measure using
DAX
Time Difference =
VAR TotalSeconds = DATEDIFF(MIN('Table'[Start Date]), MAX('Table'[End Date]), SECOND)
VAR Result_hour = INT(TotalSeconds / 3600)
VAR Result_minutes = INT(MOD(TotalSeconds, 3600) / 60)
VAR Result_second_final = MOD(TotalSeconds, 60)
RETURN FORMAT(Result_hour, "00") & ":" & FORMAT(Result_minutes, "00") & ":" & FORMAT(Result_second_final, "00")