Forum Discussion

Snowy34's avatar
Snowy34
Helper III
4 years ago
Solved

Time Duration visual

Happy New Year BI Community!!!

 

OK this one is killing me right now, I'm trying to plot a simpel grapth that shows total time spent in hours per month. I have a table that shows me this per ticket but when I try and use it in a grapth I'm getting no where with it....

 

Below screenshot shows SDO Created date/time and SDP reolved date/time and then I got SDP_Duration(time taken to resolve the issue) To get that i used the below measuer and that part works fine. But as soon as I put that measuer in to a line grapth i get nothing can't actuely even put it in to values section. I coppied SDP_Duration and changed the format of it but now I get some funny numbers in SPD Duration - Copy see below... Any help with this would be great!

acqpmtP.png (2164×1119) (imgur.com)

SDP_Duration =

VAR Elapsed_Time = SELECTEDVALUE('servicedeskDB'[SDP Duration])
VAR days = INT(Elapsed_Time)

VAR _hrs = (Elapsed_Time - days) * 24
VAR hrs = INT(_hrs)

VAR _mins = ROUNDUP((_hrs - hrs) * 60, 2)
VAR mins = INT(_mins)

VAR seconds = INT((_mins - mins) * 60)

RETURN

//Use FORMAT to FORMAT the string to use 2 chars e.g. 03 rather than just 3
days & " d " & FORMAT(hrs,"00") & " h " & FORMAT(mins,"00") & " m " & FORMAT(seconds,"00") & " s"

5 Replies