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
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
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.