Chelsie Eiden's Duration
Anonymous So this happened in another thread dealing with this. I believe the fix was to go into the Values area of the visual and turn off auto display format and change it to None and then the custom format string worked as designed.
Greg_Deckler I have a similar issue as mentioned by Anonymous .
But in my case I have succeded in turning off auto display format and changing it to None. The custom format string 00:00:00 worked as designed.
I will like to display only hours and minutes eg. 12:34 and not 12:34:56.
How do I go about this? Using 00:00 displays 1234:57
- Greg_Deckler4 years agoCommunity Champion
Patrick_AW Try changing the last line to:
Hours * 100 + Minutes
Then try a custom format string like 0000:00 or 00:00
- Patrick_AW4 years agoNew Member
Thanks Greg.
Custom format of 00:00 works with the above.
- VizKid4 years agoFrequent Visitor
Greg_Deckler I have similar requirements
In my case I have also setup proper formating and successfully shown on Graphs with Auto off with HH:MM and MM:SS - I am really glad for your post!! 🙂
In addition user wants to view it in DD:HH:MM, Any idea how can I get to show in this format?Thanks so much
- Greg_Deckler4 years agoCommunity Champion
VizKid I am thinking this:
// We start with a duration in number of seconds VAR Duration = SUM([Duration]) // There are 86,400 seconds in an day VAR Days = INT ( Duration / 86400) // There are 3600 seconds in a hour VAR Hours = INT ( MOD( Duration - ( Hours * 86400 ),86400 ) / 3600) // Remaining seconds are the remainder of the seconds divided by 60 after subtracting out the hours VAR Minutes = INT (MOD ( MOD( Duration - ( Hours * 86400 ),86400 ), 3600 ) / 60) RETURN // We put the hours, minutes and seconds into the proper "place" Days * 10000 + Hours * 100 + Minutes- VizKid4 years agoFrequent Visitor
Awesome - thanks so much Greg_Deckler for your valueable help/feedback 🙂
I think I got it (Made one minor change). wanted to loop you back in... When I try to use DAX above, there was a typo maybe...
VAR Hours = INT ( MOD( Duration - ( Hours * 86400 ),86400 ) / 3600)
So I updated to resolve - Thoughts?// We start with a duration in number of seconds VAR Duration = SUM([Duration]) // There are 86,400 seconds in an day VAR Days = INT ( Duration / 86400) // There are 3600 seconds in a hour VAR Hours = INT ( MOD( Duration - ( Days * 86400 ),86400 ) / 3600) // Remaining seconds are the remainder of the seconds divided by 60 after subtracting out the hours VAR Minutes = INT (MOD ( MOD( Duration - ( Days * 86400 ),86400 ), 3600 ) / 60) RETURN // We put the hours, minutes and seconds into the proper "place" Days * 10000 + Hours * 100 + Minutes