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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
dreaves1
Helper II
Helper II

How to calculate cost of hire

I have two tables, an Agency Invoice Table and a Hires Table. Both tables have mutliple key identifies (Req Number and Agency Name) that I'm trying to use to connect the two tables together to show the number of hires for each row of the Agency Table and to cost of hire (the amount we spent with the agency divided by the number of hires made by that agency). Below is an example of the two tables. How can I create a formula that creates a new column in the Agency Table that counts the number of hires from the Hires Table? Then, what formula will I use to calculate cost of hire?

 

Agency Table

Agency NameReq Number1Req Number2Amount
Example1100102$20,000
Example2103 $15,000
Example3104 $10,000

 

Hires Table

Candidate NameReq NumberAgency Name
John Doe100Example1
Jane Doe102Example1
Test Doe103Example2
Michael Jordan104Example3
1 ACCEPTED SOLUTION
v-stephen-msft
Community Support
Community Support

Hi @dreaves1 ,

 

Here's my solution.

 

1.In the Power Query Editor, select the two columns of Req Number, and then click Unpivot.

vstephenmsft_1-1637659049571.png

Then you will get this.

vstephenmsft_2-1637659100162.png

 

2.Create the following calculated columns in the two tables respectively.

AgenceyName&ReqNumber = [Agency Name]&"-"&[Value]

vstephenmsft_4-1637659285327.png

 

AgenceyName&ReqNumber = [Agency Name]&"-"&[Req Number]

vstephenmsft_3-1637659279778.png

 

3.Create a relationship between tables.

vstephenmsft_5-1637659317289.png

 

4.Create a table visual with the following fields. The visual shows the cost of hire.

vstephenmsft_6-1637659395136.png

 

 

 

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

3 REPLIES 3
v-stephen-msft
Community Support
Community Support

Hi @dreaves1 ,

 

Here's my solution.

 

1.In the Power Query Editor, select the two columns of Req Number, and then click Unpivot.

vstephenmsft_1-1637659049571.png

Then you will get this.

vstephenmsft_2-1637659100162.png

 

2.Create the following calculated columns in the two tables respectively.

AgenceyName&ReqNumber = [Agency Name]&"-"&[Value]

vstephenmsft_4-1637659285327.png

 

AgenceyName&ReqNumber = [Agency Name]&"-"&[Req Number]

vstephenmsft_3-1637659279778.png

 

3.Create a relationship between tables.

vstephenmsft_5-1637659317289.png

 

4.Create a table visual with the following fields. The visual shows the cost of hire.

vstephenmsft_6-1637659395136.png

 

 

 

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

smpa01
Super User
Super User

@dreaves1  what is your desired output?

Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs

I'm trying to calculate cost of hire.

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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