Forum Discussion
Power BI Total Time Calculation
Hello All,
I am trying to calculate overall time an agent had spent on different task in Power BI Desktop. Please help me resolve this issue. We have multiple agent who are working on different task at the same time. each task requires different time period to perform. i want to know overall time spent by each agent on different tickets. Thank you all for your help.
| Agent ID | Job Performed | Time | ||
| 1 | 3D Print | 0:20:00 | ||
| 2 | Fabrication | 0:30:00 | ||
| 2 | CAD | 16:00:00 | ||
| 2 | Design Help | 1:00:00 | ||
| 3 | ME | 5:00:00 | ||
| 3 | ME | 6:00:00 | ||
| 4 | CAD | 1:00:00 | ||
| 4 | 3D print | 0:30:00 | ||
| 4 | 3D Print | 0:30:00 |
Hi vsinne,
Please check out the attachment. If it's what you want?
TimeCosts = VAR total = SUM ( Table1[Seconds] ) VAR hours = INT ( total / 3600 ) VAR minutes = INT ( MOD ( total, 3600 ) / 60 ) VAR seconds = MOD ( MOD ( total, 3600 ), 60 ) RETURN hours & " hours " & minutes & " minutes " & seconds & " seconds"Best Regards,
Dale
5 Replies
- Greg_DecklerCommunity Champion
Seems like you need my Duration to Seconds Quick Measure:
https://community.powerbi.com/t5/Quick-Measures-Gallery/Duration-to-Seconds-Converter/m-p/342279
- vsinneFrequent Visitor
If i convert it in Seconds, how can i calculate agent wise total time. How much overall time each agent had spent on those tasks in a limited time period.
- Greg_DecklerCommunity Champion
Create a calculated column that converts to seconds. Use a measure to SUM that column. I don't know what, specifically, you are trying to achieve. Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490
- v-jiascu-msftMicrosoft Employee
Hi vsinne,
Please check out the attachment. If it's what you want?
TimeCosts = VAR total = SUM ( Table1[Seconds] ) VAR hours = INT ( total / 3600 ) VAR minutes = INT ( MOD ( total, 3600 ) / 60 ) VAR seconds = MOD ( MOD ( total, 3600 ), 60 ) RETURN hours & " hours " & minutes & " minutes " & seconds & " seconds"Best Regards,
Dale
- vsinneFrequent Visitor
Thank You so much.
