Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more
Good day
I am trying to get total time worked for employees from our clock in machines,
how do i calculate the total time worked
Snippet below of sample data
Solved! Go to Solution.
hi, @TaariqHussain
try below code
Column =
var a = HOUR('Table'[Clock out])-HOUR('Table'[Clock in])
var b = MINUTE('Table'[Clock out])-MINUTE('Table'[Clock in])
var c = SECOND('Table'[Clock out])-SECOND('Table'[Clock in])
return
a +(b/60)+(c/3600)
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.and don't forgot to give kudos.
hi, @TaariqHussain
try below
column =
sumx(
filter(
'Table',
'Table'[emp#]=earlier('Table'[emp#])
),
FORMAT('Table (3)'[clock out]-'Table (3)'[clock in],"hh:mm:ss")
)
hi, @TaariqHussain
column =
var a = HOUR('Table (3)'[clock out])-HOUR('Table (3)'[clock in])
var b = MINUTE('Table (3)'[clock out])-MINUTE('Table (3)'[clock in])
var c = SECOND('Table (3)'[clock out])-SECOND('Table (3)'[clock in])
var d = a+ (b/60)+( c/3600)
return
sumx(
filter(
'Table',
'Table'[emp#]=earlier('Table'[emp#])
),
d
)
change value of decimal place because above code show time in HOUR
Thanks, that never give an error but is showing the data below which doesnt look right, on average its 8 hours a day
where do i change the value of decimel place
hi, @TaariqHussain
provide data in table form
copy data and paste in table form here
| Megachicks Jarrison.xlsx | Date | Emp # | Name | NT | Short | 1.5 | 2 | PPH | PPHW | Clock in | Clock out | Modified Date | Time worked |
| Megachicks Jarrison.xlsx | 29/12/2023 | TN01 | TAARIQ HUSSAIN | 9.23 | 0.02 | 0 | 0 | 0 | 0 | 07:31:00 | 16:45:00 | 29-Dec-23 | 379 |
| Megachicks Jarrison.xlsx | 27/12/2023 | TN01 | TAARIQ HUSSAIN | 8.42 | 0.83 | 0 | 0 | 0 | 0 | 07:25:00 | 16:50:00 | 27-Dec-23 | 241 |
hi, @TaariqHussain
try below code
Column =
var a = HOUR('Table'[Clock out])-HOUR('Table'[Clock in])
var b = MINUTE('Table'[Clock out])-MINUTE('Table'[Clock in])
var c = SECOND('Table'[Clock out])-SECOND('Table'[Clock in])
return
a +(b/60)+(c/3600)
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.and don't forgot to give kudos.
Hi @Dangar332
| Megachicks Jarrison.xlsx | Date | Emp # | Name | NT | Short | 1.5 | 2 | PPH | PPHW | Clock in | Clock out | Modified Date | Time worked |
| Megachicks Jarrison.xlsx | 29/12/2023 | TN01 | TAARIQ HUSSAIN | 9.23 | 0.02 | 0 | 0 | 0 | 0 | 07:31:00 | 16:45:00 | 29-Dec-23 | 379 |
| Megachicks Jarrison.xlsx | 27/12/2023 | TN01 | TAARIQ HUSSAIN | 8.42 | 0.83 | 0 | 0 | 0 | 0 | 07:25:00 | 16:50:00 | 27-Dec-23 | 241 |
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.