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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch 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
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!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.