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

Problems with hour format greater than 24 hours

Hi there,

 

How to find average of time which is more then 24 hours in power Bi like 158 hours is average time taken by lab to complete one report of patient.

 

example this is below data from excel. Average formula is used.

 

Untitled.jpg

 

 

 

 

 

 

 

 

Please help

4 REPLIES 4
Anonymous
Not applicable

DAX Mode ( In this mode you can agregate for any dimension)

 

QtSegundos = SUM([Seconds])

 

Time=
VAR Horas = INT([QtSegundos]/3600)
VAR Minutos = INT(([QtSegundos] - (Horas * 3600))/60)
VAR Segundos = MOD([QtSegundos];60)
RETURN
Horas&":"&FORMAT(Minutos;"00")&":"&FORMAT(Segundos;"00")
fhill
Resident Rockstar
Resident Rockstar

....  This is as close as I can get to what you are tryingn to do....

 

I have broke up your TEXT data by delimiter then recalculated a custom column to determine your duration in **DAYS**.  Days is required to conver to Duration (Not pictured);  I 'Change Type' in Power BI Query Editor to convert the newly calcualted column back into a Duration.  This changes your 53:22:40 example into 2.05:22:40 in Duration Formatting.

 

Now that I have a Duration formatted column, I can easily Average in Power BI.  The hard part (where i'm stuck) is converting the duration Average back into HH:MM:SS foramt??  My 2nd screen shot below is Average Hours, mabye someone can pick up it from here???

 

FOrrest

 

Capture2.PNGCapture.PNG




Did I answer your question, or help you along the way?
Please give Kudos or Mark as a Solution!


https://www.linkedin.com/in/forrest-hill-04480730/

Proud to give back to the community!
Thank You!




Thanks for your help pal.

 

Really appreciate this but inspite of splitting the data cant we do the same with exicting format of time as 53:22:40  HH:MM:SS.

 

 

Thanks alot

 

 

Hi @Shaik_amir,

 

So you want to convert the result to time format, right?
If this is a case, you can take a look at below link, and use 'TIMEVALUE' function to convert these text to time value:

Converting Decimal Hours to Time Format

TIMEVALUE Function (DAX)

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

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.