Forum Discussion

heidibb's avatar
heidibb
Helper IV
10 years ago
Solved

Duration Troubles

Hello, I am working on a project around runs, the duration for each run in hh:mm:ss and the pace (duration/total miles). My data is being captured in a google sheet, where I have the column defined ...
  • heidibb's avatar
    heidibb
    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" )
    )