Forum Discussion

efilipe's avatar
efilipe
Icon for Helper IV rankHelper IV
8 years ago
Solved

Decimal to HH:MM:SS

Hi guys,   I have numbers with decimals, like:   19,400 8,50 14,70 56,000   The are miliseconds of videos. I need to transform that to HH:MM:SS. Is it possible? And after, will the column...
  • v-qiuyu-msft's avatar
    8 years ago

    Hi efilipe,

     

    Please create a measure below: 

     

    HH:MM: SS = RIGHT ( "0" & INT ( SUMX('Miliseconds2HH:MM: SS', 'Miliseconds2HH:MM: SS'[Miliseconds]) / 3600000 ), 2 )
        & ":"
        & RIGHT (
            "0"
                & INT ( ( SUMX('Miliseconds2HH:MM: SS', 'Miliseconds2HH:MM: SS'[Miliseconds]) - INT (SUMX('Miliseconds2HH:MM: SS', 'Miliseconds2HH:MM: SS'[Miliseconds]) / 3600000 ) * 3600000 ) / 60000 ),
            2
        )
        & ":"
    & RIGHT ( "0" & INT(DIVIDE(MOD (SUMX('Miliseconds2HH:MM: SS', 'Miliseconds2HH:MM: SS'[Miliseconds]), 60000 ), 1000)), 2 )
    

     

    Best Regards,
    Qiuyun Yu