cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
wparker5932
Frequent Visitor

Multiply hours by billable rate by change factor

This should be simple but I can't make it work.

 

To calculate the Revenue from inception to date = I have a timesheet table of hours spent that spans multiple dates for multiple people doing multiple activities for multiple projects.  I want to multiply the hours by a billable rate table where the rates differ by activity the multiply the results by a change factor (the billable rate is in British Pounds and I need to convert to USD) that changes each month.  I have set a relationship to the Activities and the Date fields. I cannot figure out how to multiple all of the hours for one month by the rate for the activity and then adjust the result by the change factor for that month.

 

GDP to USD Table

DateExchange Rate
11/30/20141.5784
12/31/20141.56344
1/31/20151.51369
2/28/20151.53154
3/31/20151.49803
4/30/20151.49353
5/31/20151.54586
6/30/20151.55726
7/31/20151.55573
8/31/20151.55865

 

Billabale Rate Table

Activity NameRate
Administration£24.00
Data Manipulate£32.50
DCS Inbox£24.00
Hardware & Software maintenance£24.00
Hardware/Software£32.50
Location Review£24.00
Meetings£32.50
On The Job Training£0.00
Open time£0.00
Procedure Review£0.00
Processing£32.00
Quality Control£32.00
Scor Corrections£26.00
Team Administration£24.00
Training£32.00
Underwriting Support£32.50

 

Timesheet Table

DateNameActvity NameProject NameHours
5/31/2016ChloeAdministrationU/W Support0.25
5/31/2016 ChloeData ManipulateU/W Support4.50
6/1/2016 VanessaClerical SupportU/W Support2.50
6/1/2016JessicaClerical SupportU/W Support8.00
6/1/2016RayneData ManipulateU/W Support3.00
6/1/2016RayneLocation ReviewU/W Support1.75
6/1/2016ChristineProcessingU/W Support5.00
6/1/2016GlennAdministrationU/W Support1.00
6/1/2016GlennData ManipulateU/W Support2.50
6/1/2016GlennHardware & Software maintenancU/W Support0.25
6/1/2016GlennTraining-general businessU/W Support3.50
     
1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Multiply hours by billable rate by change factor

Hi @wparker5932

Multiply gets hour*billable rate based on each row context without taking any other condition into consideration. So it does not get the total hour*billable rate as you wanted.

Multipleforonmonth sums the values in “Multiply” column based on the month/year and activity name, thus get the total hour*billable rate as you said.

If my reply help you solve your problem,could you please accept it as a sloved solution?

 

Best Regards

Maggie

View solution in original post

6 REPLIES 6
Community Support
Community Support

Re: Multiply hours by billable rate by change factor

First, let me confirm some details with you.
1.“multiple all of the hours for one month by the rate for the activity”
As your example, the result of multiplying all of the hours for May of 2016 by the rate for the activity is as follows:
3.png4.png
Result=0.25*24+4.5*32.5
 
2.As to the GDP to USD Table, it shows the different Exchange Rate for each month of different year.
For example, the Exchange Rate for November of 2014 is 1.5784, that for December is 1.56344.
5.png
 
3.“adjust the result by the change factor for that month”
Based on my two example above, If the Exchange Rate for May of 2016 is 1.2, so the final result should be:
Final result=(0.25*24+4.5*32.5)*1.2
Is my understanding right? If not, please point out the correct way.
 
Based on my understanding above, I test as follows.
1.In Query Editor, Split column for the column ”Rate” to extract the number from the string.
6.png
7.png
 
2.Create calculated column in GDP to USD Table
month/year = CONCATENATE(CONCATENATE(MONTH([Date]),"/"),YEAR([Date]))
8.png
 
3. create columns in Timesheet Table
month/year = CONCATENATE(CONCATENATE(MONTH([Date]),"/"),YEAR([Date]))
mutiply = [Hours]*RELATED('Billabale Rate'[Rate])
multipleforonmonth = CALCULATE(SUM([mutiply]),FILTER(ALL(Timesheet),[month/year]=EARLIER([month/year])))
final result = [multipleforonmonth]*RELATED('GDP to USD'[Exchange Rate])
9.png
 
Here is my pbix.
 
Best Regards
Maggie
wparker5932
Frequent Visitor

Re: Multiply hours by billable rate by change factor

There is one step that confuses me and it may be why the results appear to be incorrect.

 

I'm not sure how multipleforonmonth = CALCULATE(SUM([mutiply]),FILTER(ALL(Timesheet),[month/year]=EARLIER([month/year]))) works.  I am assuming it should sum the total hour*billable rate, by month, by activity name. The results are coming out much too high (billions of $ when it should be hundreds of thousands of $).  

 

My relationships match your example and the formulas as well.

 

Power BI Relationships 1.jpgPower BI Screen 1.jpg

 

What am I missing?

Community Support
Community Support

Re: Multiply hours by billable rate by change factor

Hi @wparker5932

“it should sum the total hour*billable rate, by month, by activity name”

I modify “multipleforonmonth” as below

multipleforonmonth =
CALCULATE (
    SUM ( [mutiply] ),
    FILTER (
        ALLEXCEPT ( Timesheet, Timesheet[Actvity Name] ),
        [month/year] = EARLIER ( [month/year] )
    )
)

If it is still not correct, please review the example where I described at the first of my reply to let me know if I misunderstand something.  

 

 

Best Regards

Maggie

wparker5932
Frequent Visitor

Re: Multiply hours by billable rate by change factor

Maggie,

 

Here is what I am seeing.  I created a page that displays the Month/Year from the GDP to USD table, the Month/Year from the Timesheet Table, and multiply, multiplyforonemonth and final result from the Timesheet table.

 

I then used a filter to display just one month/year (3/2018).

 

I believe what I should see is that multiply ($16,588.75) and multipleforonemonth ($28,742,322.00) should be equal but they are not. 

 

The final result appears to be applying the correct factor of 1.4082

 

  

What does multipleforonemonth do that is a next step after multiply?

 

If I change to: final result = [mutiply]*RELATED('GBP to USD'[Rate]), I believe I have the correct answer ($23,360) but I would still like to know what multipleforonemonth is intended to calculate.

 

 (Sorry, I have screen captures to share but for the life of me, cannot figure out how to insert them using the icon above)

.

Best regards,

W. Parker


wparker5932
Frequent Visitor

Re: Multiply hours by billable rate by change factor

multipleforonemonth.jpgUsing multipleforonemonth in final result equationMultiply.jpgusing Multiply in final result equation

Highlighted
Community Support
Community Support

Re: Multiply hours by billable rate by change factor

Hi @wparker5932

Multiply gets hour*billable rate based on each row context without taking any other condition into consideration. So it does not get the total hour*billable rate as you wanted.

Multipleforonmonth sums the values in “Multiply” column based on the month/year and activity name, thus get the total hour*billable rate as you said.

If my reply help you solve your problem,could you please accept it as a sloved solution?

 

Best Regards

Maggie

View solution in original post

Helpful resources

Announcements
Announcing the New Spanish Forum

Announcing the New Spanish Forum

Do you need help in Spanish? Check out our new Spanish community section.

April 2020 Community Highlights

April 2020 Community Highlights

Info on our Super Users, MBAS content and badges, and updates to our support articles. - Read the full Community Highlights.

MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

Top Solution Authors
Top Kudoed Authors