cancel
Showing results for
Did you mean:
Frequent Visitor

## Sum of column values from different tables

I have 2 tables with a common column. The relationship has already been established. I want to add the values in the columns to get a total score for each row. How do I do this? See example tables below. The supplier column is the common column. I want the final table to be all the metrics and the supplier and the total score.

Table 1

 Supplier Metric 1 Metric 2 Supplier A 5 10 Supplier B 10 15 Supplier C 0 15

Table 2

 Supplier Metric 3 Metric 4 Supplier A 5 20 Supplier B 15 15 Supplier C 0 5

Final table

 Supplier Metric 1 Metric 2 Metric 3 Metric 4 Total Score Supplier A 5 10 5 20 40 Supplier B 10 15 15 15 55 Supplier C 0 15 0 5 20

1 ACCEPTED SOLUTION
Super User

You really don't need to create a new table.

``````Metric3 = RELATED( Table2[Metric 3] )
Metric4 = RELATED(Table2[Metric 4] )
Total = [Metric 1] + [Metric 2] + [Metric3] + [Metric4]

``````

SupplierMetric 1Metric 2Metric3Metric4Total

 Supplier A 5 10 5 20 40 Supplier B 10 15 15 15 55 Supplier C 0 15 0 5 20

The Related function works because you have created the Supplier relationship.

If you really do need or want a separate table, just copy Table1 and give it another name (i.e "Final Table),

Regards,

4 REPLIES 4
Super User

You really don't need to create a new table.

``````Metric3 = RELATED( Table2[Metric 3] )
Metric4 = RELATED(Table2[Metric 4] )
Total = [Metric 1] + [Metric 2] + [Metric3] + [Metric4]

``````

SupplierMetric 1Metric 2Metric3Metric4Total

 Supplier A 5 10 5 20 40 Supplier B 10 15 15 15 55 Supplier C 0 15 0 5 20

The Related function works because you have created the Supplier relationship.

If you really do need or want a separate table, just copy Table1 and give it another name (i.e "Final Table),

Regards,

Frequent Visitor

Amazing! It worked! You are a lifesaver!

Super User

@jeanramonyap , You need to create common supplier dimension

then you can 4 measure and 1 sum of all 4

Total = Sum(Table1[Metric1])+ Sum(Table1[Metric2])+ Sum(Table2[Metric3])+ Sum(Table2[Metric4])

Features || Datamarts: https://youtu.be/8tskWsJTEpg || Field Parameters : https://youtu.be/lqF3Wa1FllE?t=70
Learn Power BI P&L Statement || Time Intelligence Decoded : https://youtu.be/aU2aKbnHuWs&t=145s ||
Did I answer your question? Mark my post as a solution! Appreciate your Kudos !! Proud to be a Super User! !!
Dashboard of My Blogs !! Connect on Linkedin !! Subscribe to my youtube Channel !!!! How to get Quick Help !!
Resources | Master Power BI !! Expertise Power BI !! Power BI For Tableau User !!
Frequent Visitor

This doesn't work because I don't want the sum per column. I want the evaluation to be row by row. Your recommendation will sum the values for metric 1 + sum of values for metric 2 and so on, which is something I don't want.  The final table has to look like this.

 Supplier Metric 1 Metric 2 Metric 3 Metric 4 Total Score Supplier A 5 10 5 20 40 Supplier B 10 15 15 15 55 Supplier C 0 15 0 5 20

Announcements

#### Difinity Conference 2022

Difinity is the largest Microsoft Data, AI, Power BI, Power Platform and Business Applications Conference in New Zealand.

#### European Share Point Conference

This conference returns live and in-person in Copenhagen this 28 November-01 December with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

#### Microsoft 365 Conference - 06-08 December

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Top Solution Authors
Top Kudoed Authors