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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

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!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Feb2025 NL Carousel

Fabric Community Update - February 2025

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