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

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

Reply
vsinne
Frequent Visitor

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 IDJob Performed Time 
 13D Print0:20:00 
 2Fabrication0:30:00 
 2CAD16:00:00 
 2Design Help1:00:00 
 3ME5:00:00 
 3ME6:00:00 
 4CAD1:00:00 
 43D print0:30:00 
 43D Print0:30:00 
1 ACCEPTED SOLUTION
v-jiascu-msft
Microsoft Employee
Microsoft 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"

Power_BI_Total_Time_Calculation

 

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

5 REPLIES 5
v-jiascu-msft
Microsoft Employee
Microsoft 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"

Power_BI_Total_Time_Calculation

 

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.

Thank You so much.

Greg_Deckler
Super User
Super User

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

 



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

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.

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



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

Feb2025 NL Carousel

Fabric Community Update - February 2025

Find out what's new and trending in the Fabric community.

Top Kudoed Authors