Forum Discussion
PBI seconds conversion to hh:mm
Hello,
I've tried two different formulas I've found in these forums. At first it looks like it is working but then the math isn't mathing when reviewing the output.
In the below example, you can see 7200 seconds is calclating to 1 hour however is should be 2 hours. You can then see there are several 3600 second items that correctly display as 1 hour. I exported to excel and did an Excel conversion and found several instances where the PBI calculation appears correctly and in others not with no identifiable pattern. Of 14 instances of 14400 seconds, 3 PBI shows as 2 hours and the remaining correct at 4 hours.
I've tried both formulas below:
3 Replies
- aj1973
Community Champion
Hi shannon8000
Here is an example
and here is the formula
Total duration =var _seconds = SUM(Sheet1[ACTVTY_TTL_SEC])var _minutes = INT(_seconds / 60)var _RemainingSeconds = MOD(_seconds, 60)var _Hours = INT(_minutes / 60)var _RemainingMinutes = MOD(_minutes, 60)var _Days = INT(_Hours / 24)var _RemainingHours = MOD(_Hours, 24)return_Days & " D : " &_RemainingHours & " H : " &_RemainingMinutes & " M : " &_RemainingSeconds & " S "- shannon8000Frequent Visitor
Hi Amine!
I applied as recommended and the output was interesing.
I will poke around some more to see what is happening.
- aj1973
Community Champion
You have a relationship problem in your Matrix or Table visual.