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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
evega
Frequent Visitor

How to add hours in power bi using DAX measurements

I have recently developed a measure in a context where filters are used to add up the total hours, but the result is not correct. 

 

Screenshot_11.png

1 ACCEPTED SOLUTION
TheoC
Super User
Super User

Hi @evega

Add this as a Calculated Column:

 

Total Time = 

VAR _TotalHours = INT ( LEFT ( Table[Horas] , 2 ) )
VAR _TotalMinutes = INT ( RIGHT ( Table[Horas] , 2 ) )

RETURN

_TotalHours + (_TotalMinutes / 60 )

Below is a screenshot of the output.  Hope this helps! 🙂

 

TheoC_0-1634078128083.png

 


 

If I have posted a response that resolves your question, please accept it as a solution to formally close the post.

Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!

Want to connect?www.linkedin.com/in/theoconias

View solution in original post

6 REPLIES 6
evega
Frequent Visitor

Me ha funcionado, muchas gracias!!!  @TeoC

Screenshot_14.png

TheoC
Super User
Super User

Hi @evega

Add this as a Calculated Column:

 

Total Time = 

VAR _TotalHours = INT ( LEFT ( Table[Horas] , 2 ) )
VAR _TotalMinutes = INT ( RIGHT ( Table[Horas] , 2 ) )

RETURN

_TotalHours + (_TotalMinutes / 60 )

Below is a screenshot of the output.  Hope this helps! 🙂

 

TheoC_0-1634078128083.png

 


 

If I have posted a response that resolves your question, please accept it as a solution to formally close the post.

Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!

Want to connect?www.linkedin.com/in/theoconias

evega
Frequent Visitor

Hi  @TeoC

It won't allow me.

 

Screenshot_12.png

@evega what Data Type is your Horas column?

If I have posted a response that resolves your question, please accept it as a solution to formally close the post.

Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!

Want to connect?www.linkedin.com/in/theoconias

evega
Frequent Visitor

The data type is time, but I'll try to switch to text

Hi @evega, that would be good if you could convert to text. Alternatively, I am happy to adjust to get you the output required.

 

If I have posted a response that resolves your question, please accept it as a solution to formally close the post.

Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!

Want to connect?www.linkedin.com/in/theoconias

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 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.

Top Solution Authors
Top Kudoed Authors