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
sureshsonti
Helper II
Helper II

Hours:Minutes

I have a table with Employee Code, Punch In and Punch Out values. The Data Type is Date/Time. I am trying to calculate hours:minutes for each employee and then sum all hours:minutes. I used this DAX statement 

 

TODAY_HOURS = DATEDIFF('tick'[drvt.punch_in_time_1], 'tick'[drvt.punch_out_time_1],HOUR)

 

It looks wrong. Please help

 

Hours Minutes.JPG

 

 

 

 

1 ACCEPTED SOLUTION
v-jiascu-msft
Employee
Employee

Hi @sureshsonti,

 

Seems these two columns don't have proper data type. Please check and change them into time.

Hours_Minutes

 

Best Regards,

Dale

 

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

View solution in original post

4 REPLIES 4
v-jiascu-msft
Employee
Employee

Hi @sureshsonti,

 

Could you please tell me if you get the answer or the solution?

 

Best Regards,

Dale

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

Dale,

Your solution solved my issue. Thanks for your help.

v-jiascu-msft
Employee
Employee

Hi @sureshsonti,

 

Seems these two columns don't have proper data type. Please check and change them into time.

Hours_Minutes

 

Best Regards,

Dale

 

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
ChrisMendoza
Resident Rockstar
Resident Rockstar

I believe the DATEDIFF ( ) requires the datetime value not just the time value. Try it with a datetime field.






Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

Proud to be a Super User!



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.