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
ccotton
New Member

Issues Formatting for Duration

Power BI Novice in need of figuring out how I can get a Jira import for Time to First Response to report as a duration and not text and a total count.

ccotton_0-1661526010726.png

 

 

I've tried a replace text option doing replace "h " with : and then "m " with ":00" just to try to get me in the right direction but then I get errors for the ons that show only minutes or the negative values. Is there a method I'm missing here? Almost all of the other fields show in seconds or milliseconds or even date and time, just not this field.

 

My end result is needed to know the average First Response for my report which I'm able to filter by day, month, year.

Thanks in advance. 

1 ACCEPTED SOLUTION
rsbin
Super User
Super User

@ccotton ,

I would approach your issue in the following manner:

First, either in Power Query or DAX, convert your Time to First Reponse to Seconds.  Then I use the following:

WorkItemDuration_Format = 
VAR days = 
    ROUNDDOWN([WorkItemDuration] / 86400, 0 )
VAR hours =
    ROUNDDOWN ( MOD ( [WorkItemDuration], 86400) / 3600, 0 )
VAR minutes =
    ROUNDDOWN ( MOD ( [WorkItemDuration], 3600 ) / 60, 0 )
VAR seconds =
    INT ( MOD ( [WorkItemDuration], 60 ) )
RETURN
    FORMAT(days,"00") & " days "
        & FORMAT(hours,"00") & ":"
        & FORMAT(minutes, "00")
        & ":"
        & FORMAT(seconds, "00")

You can make adjustments (like commenting out the Days) if this time frame is not needed.

Hope you can make this work for your situation.

Regards,

View solution in original post

1 REPLY 1
rsbin
Super User
Super User

@ccotton ,

I would approach your issue in the following manner:

First, either in Power Query or DAX, convert your Time to First Reponse to Seconds.  Then I use the following:

WorkItemDuration_Format = 
VAR days = 
    ROUNDDOWN([WorkItemDuration] / 86400, 0 )
VAR hours =
    ROUNDDOWN ( MOD ( [WorkItemDuration], 86400) / 3600, 0 )
VAR minutes =
    ROUNDDOWN ( MOD ( [WorkItemDuration], 3600 ) / 60, 0 )
VAR seconds =
    INT ( MOD ( [WorkItemDuration], 60 ) )
RETURN
    FORMAT(days,"00") & " days "
        & FORMAT(hours,"00") & ":"
        & FORMAT(minutes, "00")
        & ":"
        & FORMAT(seconds, "00")

You can make adjustments (like commenting out the Days) if this time frame is not needed.

Hope you can make this work for your situation.

Regards,

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.