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

A new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.

Reply
shastie
Regular Visitor

Sum Times

Hi all,

I successfully used a calculated column using DAX  to sum times that were formatted in excel to a custom format [h]:mm:ss.

 

The formula that was used :

Formatted = 
VAR _DaysInHours = INT('Table'[DateTime]) * 24
VAR _Hours = INT(MOD('Table'[DateTime],1) * 24)
VAR _Minutes = FORMAT(MOD('Table'[DateTime],1),"nn:ss")
RETURN
    _DaysInHours + _Hours & ":" & _Minutes

 

However now i do not have the option to sum these in my visualisation, only count.

 

Can anyone help?

2 REPLIES 2
Anonymous
Not applicable

Hi @shastie ,

 

 

I think you may not select Don't summarize.

3.png

 

 

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

mahoneypat
Microsoft Employee
Microsoft Employee

Your variable that uses FORMAT and your return are text type so can't be summed.  I would use a similar approach to sum everything in minutes and then divide by 60 to get total hours in decimal form.

 

Regards,

Pat

 





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Helpful resources

Announcements
May Power BI Update Carousel

Power BI Monthly Update - May 2026

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

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.