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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.