HHMMSS.Seconds

Convert duration in seconds to HH:MM:SS format string.

Syntax

DaxLib.FormatString.HHMMSS.Seconds ( )

Definition

DAX
// Convert duration in seconds to HH:MM:SS format string
// To be used on a measure that returns a value in seconds
() =>
    VAR _TotalSeconds = SELECTEDMEASURE ()

    VAR _Hours =
        INT( _TotalSeconds / 3600 )

    VAR _Minutes =
        INT( MOD( _TotalSeconds, 3600 ) / 60 )

    VAR _Seconds =
        INT( MOD( _TotalSeconds, 60 ) )

    VAR _Result =
        DaxLib.FormatString.Component.MakeStringSafe(
            FORMAT ( _Hours, "00" ) & ":" &
            FORMAT ( _Minutes, "00" ) & ":" &
            FORMAT ( _Seconds, "00" )
        )

    RETURN
        _Result

Parameters

This function takes no parameters.

Example

DaxLib.FormatString.HHMMSS.Seconds ( )

Use this function in a measure's formatStringDefinition to convert seconds to HH:MM:SS format.

Related Functions