Forum Discussion
LeoQ
Helper I
5 years agoShowing average duration in bar chart
Hi everybody! I'm stuck with this issue: I'm working with a dataset from a ticketing system. In the file I attach here (Test), I have one column of sectors and another of time that passed bewteen t...
amitchandak
Super User
5 years agoLeoQ , refer if these two can help
https://community.powerbi.com/t5/Quick-Measures-Gallery/Chelsie-Eiden-s-Duration/m-p/793639#M389
sraj
Responsive Resident
3 years agoHi - I have a question on Chelsie's duration measure link you have, what if I don't want it to roundup or down? Would like to just show the value as it is.
Chelsie Eiden's Duration AppWaittime =
// Duration formatting
// * @konstatinos 1/25/2016
// * Given a number of seconds, returns a format of "hh:mm:ss"
//
// We start with a duration in number of seconds
VAR Duration = AVERAGE([# of Mins APPTWAITtime])
// There are 3,600 seconds in an hour
VAR Hours = INT ( Duration / 3600)
// There are 60 seconds in a minute
VAR Minutes = INT ( MOD( Duration - ( Hours * 3600 ),3600 ) / 60)
// Remaining seconds are the remainder of the seconds divided by 60 after subtracting out the hours
VAR Seconds = ROUNDUP(MOD ( MOD( Duration - ( Hours * 3600 ),3600 ), 60 ),0) // We round up here to get a whole number
RETURN
// We put the hours, minutes and seconds into the proper "place"
Hours * 10000 + Minutes * 100 + Seconds