Forum Discussion
Duration Troubles
- 10 years ago
Vvelarde YES, this worked almost perfectly!! I had to make a couple tweeks, changing your semi-colons to commas and had to fix the minute & seconds sections to account for leading zeros when we have single digits (see bolded section). If you see anything off with this, let me know, but I can't thank you enough!!
DurationRUNNER =
VAR DurationRUNNER =
SUM ( RTB_Runs[Duration] )
RETURN
IF (
ROUNDDOWN ( DurationRUNNER, 0 ) > 1,
ROUNDDOWN ( DurationRUNNER, 0 ) * 24
+ HOUR ( DurationRUNNER )
& ":"
& (if(len(minute(DurationRUNNER)) > 1,minute(DurationRUNNER), "0" & minute(DurationRUNNER))
& ":"
& (if(len(second(DurationRUNNER)) > 1,second(DurationRUNNER), "0" & second(DurationRUNNER))
)),
FORMAT ( DurationRUNNER, "hh:mm:ss" )
)
Hi heidibb,
In your scenario, you can change data type of the field as time, see:
If you have any question, please feel free to ask.
Best Regards,
Qiuyun Yu
- heidibb10 years agoHelper IV
Thank you v-qiuyu-msft! That helped with the format in my data, but it won't allow me to sum up the amount of time. It only allows me to count the number of rows per runner.
So for example, if Beth had the follow runs and durations in June, I want to sum up total Duration where the final result is 13 hours, 20 minutes, 23 seconds (as hh:mm:ss it would be 13:20:23).
Any thoughts?
Date Runs Miles Duration Pace 5/31/2016 1 3 0:26:00 0:08:40 6/1/2016 1 5 0:42:00 0:08:24 6/3/2016 1 5 0:42:00 0:08:24 6/4/2016 1 9 1:17:00 0:08:33 6/5/2016 1 5 0:42:00 0:08:24 6/7/2016 1 4 0:34:00 0:08:30 6/8/2016 1 5 0:44:00 0:08:48 6/10/2016 1 4 0:37:00 0:09:15 6/11/2016 1 7 0:59:00 0:08:26 6/12/2016 1 6 1:10:00 0:11:40 6/13/2016 1 5 0:43:00 0:08:36 6/15/2016 1 5 0:42:00 0:08:24 6/17/2016 1 4 0:34:00 0:08:30 6/18/2016 1 8 1:09:00 0:08:38 6/19/2016 1 6 0:56:00 0:09:20 6/20/2016 1 5 0:43:00 0:08:36 6/21/2016 1 5 0:40:43 0:08:09