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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

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
Microsoft Employee
Microsoft 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
Microsoft Employee
Microsoft 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
Microsoft Employee
Microsoft 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
ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.