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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
Anonymous
Not applicable

Average Time Error

Hey guys,

I'm getting a error in the average time which I added with the help of average line option in further analysis. I have a datetime column and I converted it to seconds and then into hh:mm:ss format[DAX below]. When I'm adding Average line for End time of a process over a month it is giving me error in the minutes values eg : 05:73:36. Don't know why is it passing the 60 minutes value. anyone knows this error ? I'm getting correct values for all other lines . Maybe something happening due to the jumps in line?
 time2.png

DAX to convert the Datetime column

// Step 1: Convert the datetimestamp "hh:mm:ss into seconds (number format)
Var T2Seconds = MAX('Table'[END_DATE])*86400
// Step 2: We start with a duration in number of seconds
VAR Duration = INT(T2Seconds)
// Step 3: Get date as there are 86,400 seconds in an day
VAR Days = INT ( Duration / 86400)
// Step 4: Get hour as There are 3600 seconds in a hour
VAR Hours = INT ( MOD( Duration - ( Days * 86400 ),86400 ) / 3600)
// Step 5: Get minute as there are 60 seconds in a minute
VAR Minutes = INT ( MOD( Duration - ( Hours * 3600 ),3600 ) / 60)
// Step 5: Get seconds as remaining seconds are the remainder of the seconds divided by 60 after subtracting out the hours
VAR Seconds = ROUNDUP(MOD ( MOD( Duration - ( Hours * 3600 ),3600 ), 60 ),0) // We round up here to get a whole number
RETURN
// Step 6: Final ouput: We put the hours, minutes and seconds into the proper "place"
Hours * 10000 + Minutes * 100 + Seconds



1 REPLY 1

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.