cancel
Showing results for
Did you mean:

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Frequent Visitor

## 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!

1 ACCEPTED SOLUTION
Super User

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.

Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling

Proud to be a Super User!

MCSA: BI Reporting
2 REPLIES 2
Super User

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.

Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling

Proud to be a Super User!

MCSA: BI Reporting
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.

Announcements

#### Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.