Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Snowy34
Helper III
Helper III

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"
1 ACCEPTED SOLUTION
Snowy34
Helper III
Helper III

@parry2k 

Thank you for your help I have resolved the issue via query editer... simpley by just changeing dureation from days to hours lol.... 

 

SrMyUza.png (2029×502) (imgur.com)

View solution in original post

5 REPLIES 5
Snowy34
Helper III
Helper III

@parry2k 

Thank you for your help I have resolved the issue via query editer... simpley by just changeing dureation from days to hours lol.... 

 

SrMyUza.png (2029×502) (imgur.com)

parry2k
Super User
Super User

@Snowy34 you need to convert days into hours

 

Measure = 
VAR __value = [Your Value]
VAR __days = INT ( __value )
VAR __hours = ( __value - __days ) * 100
RETURN
__hours + ( __days * 60 )

 

 

Follow us on LinkedIn and YouTube.gif to our YouTube channel

 

Learn about conditional formatting at Microsoft Reactor

My latest blog post The Power of Using Calculation Groups with Inactive Relationships (Part 1) (perytus.com) I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

 

Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Thank you for that but seems wrong.

 

If we look at ticket 221458 its 1 day 52 hours and 59 seconds but the new measure is saying 64 hours should it be 24.8830556?

dETYW9A.png (2148×453) (imgur.com)

parry2k
Super User
Super User

@Snowy34 becuase you have convert it to txt and text cannot be used in the value section.

 

 

Follow us on LinkedIn and YouTube.gif to our YouTube channel

 

Learn about conditional formatting at Microsoft Reactor

My latest blog post The Power of Using Calculation Groups with Inactive Relationships (Part 1) (perytus.com) I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

 

Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

hmmm but I don't.

 

See below looking at just tickets resolved on the 14th. Total for SDP Duration is 84.54 is that 84days and 54 hours? I really need that converted to hours.

 

DBMte6G.png (2103×923) (imgur.com)

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.