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
Try this measure (hope it works)
VAR DurationRUNNER =
SUM ( Runners[Duration] )
RETURN
IF (
ROUNDDOWN ( DurationRUNNER; 0 ) > 1;
ROUNDDOWN ( DurationRUNNER; 0 ) * 24
+ HOUR ( DurationRUNNER )
& ":"
& (
MINUTE ( DurationRUNNER ) & ":"
& SECOND ( DurationRUNNER )
);
FORMAT ( DurationRUNNER; "hh:mm:ss" )
)
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" )
)