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 (power m) will work on the sum of that time?

 

Any ideas?

 

Thanks,

Ed!!

 

  • 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

     

     

2 Replies

  • v-qiuyu-msft's avatar
    v-qiuyu-msft
    Icon for Community Support rankCommunity Support

    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