Forum Discussion
formatting time value to hh:mm:ss
Hi
I am also experiencing this, have you found any solution for this?
Thanks
Guys I think I got it.
You need a field that is just seconds and use this code as a measure.
Time = FORMAT(INT(
IF(MOD([Seconds]|60)=60|0|MOD([Seconds]|60)) +
IF(MOD(INT([Seconds]/60)|60)=60|0|MOD(INT([Seconds]/60)|60)*100) +
INT([Seconds]/3600)*10000)| "00:00:00")
Seconds = the field that contains seconds.
- Anonymous3 years agoNot applicable
Thanks you! I have just updated a little bit your code to use IT in SSAS :
=FORMAT(INT( IF(MOD(('WEBSITES KPI'[Temps_passé]/1000),60)=60,0,MOD(('WEBSITES KPI'[Temps_passé]/1000),60)) + IF(MOD(INT(('WEBSITES KPI'[Temps_passé]/1000)/60),60)=60,0,MOD(INT(('WEBSITES KPI'[Temps_passé]/1000)/60),60)*100) + INT(('WEBSITES KPI'[Temps_passé]/1000)/3600)*10000), "00:00:00")
It's working fine for me 😄 !
I have divided by 1000 because I have the duration in milisecondes.