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

Data Days is here! Join us now for 60+ days of learning, challenges, and connection. Learn more

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
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

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

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.