Forum Discussion
Barrie2020
6 years agoFrequent Visitor
HHMMSS Duration Total
I currently have a column titled PlayedTime which has seconds converted to show as HH:MM:SS - this appears to be ok I have a quick measure titled TotalPlayedTime which uses this formula: TotalPl...
- Anonymous6 years ago
Hi Barrie2020 ,
Try use SUMX() function instead SUM().
https://docs.microsoft.com/en-us/dax/sumx-function-dax.
sumx(table,[TotalPlayedTime])Best Regards,
Jay
Community Support Team _ Jay Wang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
6 years agoNot applicable
First of all create a measure with the sum of all seconds:
TotalSecondsPlayedTime = CALCULATE(SUM(Seconds)
Then create this measure:
VAR Your_Time =
IF([TotalSecondsPlayedTime ] <> BLANK();
VAR Duration = [TotalSecondsPlayedTime ]
VAR hh =
INT ( Duration / 3600)
VAR Minutes =
INT ( MOD( Duration - ( hh * 3600 );3600 ) / 60)
VAR Seconds =
ROUNDUP(MOD ( MOD( Duration - ( hh * 3600 );3600 ); 60 );0)
VAR H =
IF ( LEN ( hh ) = 1;
CONCATENATE ( "0"; hh );
CONCATENATE ( ""; hh )
)
VAR M =
IF (
LEN ( Minutes ) = 1;
CONCATENATE ( "0"; Minutes );
CONCATENATE ( ""; Minutes )
)
VAR S =
IF (
LEN ( Seconds ) = 1;
CONCATENATE ( "0"; Seconds );
CONCATENATE ( ""; Seconds )
)
RETURN
CONCATENATE (
H;
CONCATENATE ( ":"; CONCATENATE ( M; CONCATENATE ( ":"; S ) ) )
); BLANK())