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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Anonymous
Not applicable

Calcuting sum of column from Table A and Multiply by value in Table B

I essentially need to Calculate Hourly Rate * Sum of Hours for User.

 

Table: HR Data (This table has one row for each user)

User ID, Hourly Rate

450294, $40

345020, $56

837498, $43

 

Table: Time Log Data (This table has many rows for users with many projects and dates

User ID, Project, Hours

450294, Project A, 20

450294, Project B, 80

450294, Project C, 5

345020, Project A, 40

345020, Project B, 40

345020, Project C, 20

837498, Project A, 13

837498, Project B, 20

837498, Project C, 5

 

Any ideas? I'm open to doing a measure OR creating a new table. But I was not able to make a custom column in one table because I could not get it to pull data from the other. 

1 ACCEPTED SOLUTION
Fowmy
Super User
Super User

@Anonymous 

You can create a relationship between the two tables and use the following measure. Insert a Table Visual on the canvas, insert user id from User table and the measure

Total = 
SUMX(
    Users,
    Users[ Hourly Rate] * CALCULATE(SUM('Time Log'[ Hours]))
)

Fowmy_0-1604260423080.png

 

________________________

If my answer was helpful, please consider Accept it as the solution to help the other members find it

Click on the Thumbs-Up icon if you like this reply 🙂

YouTube  LinkedIn

 



Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

View solution in original post

2 REPLIES 2
Fowmy
Super User
Super User

@Anonymous 

You can create a relationship between the two tables and use the following measure. Insert a Table Visual on the canvas, insert user id from User table and the measure

Total = 
SUMX(
    Users,
    Users[ Hourly Rate] * CALCULATE(SUM('Time Log'[ Hours]))
)

Fowmy_0-1604260423080.png

 

________________________

If my answer was helpful, please consider Accept it as the solution to help the other members find it

Click on the Thumbs-Up icon if you like this reply 🙂

YouTube  LinkedIn

 



Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Anonymous
Not applicable

Thank you, this is exactly what I needed! 

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! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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