cancel
Showing results for
Did you mean:

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a \$100 discount. Register Now

Helper I

## 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
Super User

@cynthiabucher

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]))
)``````

________________________

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 🙂

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

@cynthiabucher

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]))
)``````

________________________

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 🙂

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

Thank you, this is exactly what I needed!

Announcements

#### Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

#### Power BI Monthly Update - February 2024

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

#### Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

#### Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.

Top Solution Authors
Top Kudoed Authors