Forum Discussion
Divide wage by time
Hi,
How can I divide sum(total wages)/time(''hh:mm:ss") to get a rate? Is that possible?
Total wage is in decimal number format and time is in text format
Thanks!
You have to convert the time into a number powerbiadmin123
I recommend you do this in Power Query as it is a very simple function - two functions actually.Add a custom column, and use this formula:
Number.From(Time.FromText([Column1]))It will convert it into a part of a day as shown below.
You can then use Number.Round() around it of you do not want all of those decimals used in your calculation.
2 Replies
- rogletree
Helper III
If you are wanting to get an hourly rate, you would need to convert your time to hours then do the division that way. You should change the format of your time from text to time or date/time though. Then once you do that you can do Time.Hour(*yourTimeColumn*) + Time.Minute(*yourTimeColumn*)/60 + Time.Second(*yourTimeColumn*)/60/60 to get the total hours. Then take the total wages and divide by that.
That's how to do it in power query BTW.
- edhans
Community Champion
You have to convert the time into a number powerbiadmin123
I recommend you do this in Power Query as it is a very simple function - two functions actually.Add a custom column, and use this formula:
Number.From(Time.FromText([Column1]))It will convert it into a part of a day as shown below.
You can then use Number.Round() around it of you do not want all of those decimals used in your calculation.