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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
powerbiadmin123
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
edhans
Super User
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.

edhans_0-1601308905300.png

You can then use Number.Round() around it of you do not want all of those decimals used in your calculation.

 



Did I answer your question? Mark my post as a solution!
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

View solution in original post

2 REPLIES 2
edhans
Super User
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.

edhans_0-1601308905300.png

You can then use Number.Round() around it of you do not want all of those decimals used in your calculation.

 



Did I answer your question? Mark my post as a solution!
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
rogletree
Helper III
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.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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