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
ProverbialPaul
Regular Visitor

Calculating cost of duration/time spent on a task

Hello all

 

I have a table that records the start and finish time of repairing an item and a calculated column that works out the associated duration.

 

From this, I have two measures to take the decimal duration figure to turn it into hours/mins and, separately, minutes spent on the task so I can show that in my reports.

 

I now want to work out how I can calculate, using a measure, the cost of this time. I'm not sure if I should be using the calculated duration figure or either one of the measures to accomplish this.

 

I don't have the labour cost recorded in the same table as the calculated duration column but I can add it into another table to use a lookup function if need be. I tried a multitude of ways on my own but I just can't seem to work this one out.

 

Hoping someone can help. Thank you

1 ACCEPTED SOLUTION

The measure can be as simple as this

Measure = SUM('Module Repairs'[Time taken - Duration])*30*24

There is no need for the Labour cost table.  Sorry for that incorrect suggestion.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

10 REPLIES 10
ProverbialPaul
Regular Visitor

Hello @danextian

 

I have a start and finish time:

 

ProverbialPaul_0-1653872721712.png

 

I have a duration column:

 

ProverbialPaul_1-1653872779110.png

 

Inside my report, I have 2 measures calculating hours and minutes taken using the duration:

 

ProverbialPaul_2-1653872886024.png

 

And, separately, but similar to the above DAX function, just the minutes taken.

 

I would now like to create a measue to calculate the cost of the time taken to complete each task but I'm unsure how I should be going about this.

 

The outcome is to have a card in the report with a dollar figure showing the labour cost of the time taken to complete the selected tasks.

 

The main table is built as per the following:

 

ProverbialPaul_3-1653873428655.png

 

so it doesn't make sense to record the hourly labour rate ($30) or rate per minute ($0.5) against each item in this table so I was hoping to achieve the outcome using a measure or calculated column.

 

I hope this makes more sense. I appreciate your help. Thank you

Hi,

Share the download link of your PBI file.  Share the othe table of hourly rates as well. 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Hi @Ashish_Mathur 

 

I don't currently have PBI pro so I can't share links unfortunately. Unless there's another way I can do it?

 

Also, the report doesn't currently have a table containing the hourly rate as I deleted it because I thought I was doing it the wrong way.

 

Thank you

I will need some file to work with.  You will defeinitely need the hourly rate table.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Hi guys

 

Sorry, I never thought about using an external storage facility.

 

Link to PBI file is here:

 

https://drive.google.com/file/d/1ex7yJ7Z6FUDc40NQ0Bq1csO22CYpFtVK/view?usp=sharing

 

I re-created the labour cost table:

 

ProverbialPaul_0-1653881866591.png

 

and tried a similar function to one I had used previously to calculate cost which looks like this:

 

Labour cost =
SUM ('Module Repairs'[Time taken - Duration]) * LOOKUPVALUE ('Labour cost'[Rate],'Labour cost'[Unit of time], "Hour")
 
But if you look at the "Daily totals" tab I get a total of $5.9375 when it should be $142.50. I'm stumped!
 
I think it has something to do with me using the duration calculation but I'm really not sure anymore.
 
Thank you

The measure can be as simple as this

Measure = SUM('Module Repairs'[Time taken - Duration])*30*24

There is no need for the Labour cost table.  Sorry for that incorrect suggestion.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Thank you so much @Ashish_Mathur 

 

I really appreciate your help.

 

I had a feeling it was going to be simple but I was going cross eyed.

You are welcome.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

You can use Google Drive, One Drive or Dropbox.





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.
danextian
Super User
Super User

Hi @ProverbialPaul ,

 

Please post a sample data and your expected result.

https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/td-p/1447523/jump... 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

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!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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.