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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

how do I calculate the total working time per day, per week, per year

I have a table with different times for different technicians each day. I would like to calculate the total worked time per day per technician, per week, per month, and per year. What is the correct DAX formula for this? I already have several calculations. The total time per day per technician seems to be correct. However, when I try to display this in a matrix table per week or per month, it doesn't sum up the times. It keeps looking at the first time and the last time per period. Who has a suitable solution?

Example:

FransArnaud_0-1701077729544.png

 

1 ACCEPTED SOLUTION
speedramps
Super User
Super User

Does you column have a time data type?

Time data types have a maximum of 24hrs. 

So if you add 23 + 2 = 1 and not 25!

And 8 + 8 + 8 + 8 + 8 = 16 and not 40.

Try using a decimal data type.

 

View solution in original post

3 REPLIES 3
speedramps
Super User
Super User

Does you column have a time data type?

Time data types have a maximum of 24hrs. 

So if you add 23 + 2 = 1 and not 25!

And 8 + 8 + 8 + 8 + 8 = 16 and not 40.

Try using a decimal data type.

 

Anonymous
Not applicable

To find the first time of the day per technician:

  • Min Time StartArbeid = MIN(PTS_Z14IT_CRM_HR_DAT[StartArbeid])
  • Min Time StartReisHeen = MINX(FILTER(PTS_Z14IT_CRM_HR_DAT,PTS_Z14IT_CRM_HR_DAT[StartReisHeen] <> 0 ),PTS_Z14IT_CRM_HR_DAT[StartReisHeen])
  • Min Time = MINX({[Min Time StartReisHeen],[Min Time StartArbeid]},[Value])

To find the last time of the day per technician:

  • Max Time TijdEindeArbeid = MAX(PTS_Z14IT_CRM_HR_DAT[EindeArbeid])
  • Max Time EindeReisTerug = MAX(PTS_Z14IT_CRM_HR_DAT[EindeReisTerug])
  • Max Time = MAXX({[Max Time EindeReisTerug],[Max Time TijdEindeArbeid]},[Value])

To find the total working time per day per technician:

  • Totale tijd min = CALCULATE(DATEDIFF([Min Time],[Max Time],MINUTE)) //
  • Totale tijd uur = [Totale tijd min]/60

 

Then the ‘Totale tijd min’ provides the total working time in minutes per day. When I place this as a value in a matrix table, I get an incorrect calculation of the total time. Also, when I try to see the total working time per week, I do not get accurate results.

 

FransArnaud_0-1701120138551.png

 

Anonymous
Not applicable

I have a solution. 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.