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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

Lookup value from table_2 and sum it [DAX]

Hi, 

my target is to sum the values from table_1  and insert them into table_2.

 

 

How can I do that with DAX? 

Example is shown below:

Case.PNG

1 ACCEPTED SOLUTION
v-easonf-msft
Community Support
Community Support

Hi,  @Anonymous 

You need to create a summarize table first (calcualted table)

Tab = SUMMARIZE(Table1,Table1[Name No],Table1[Name],"Cost",SUM(Table1[Costs]))

Tehn using lookupvalue to create a calculated column.

C_Costs = LOOKUPVALUE(Tab[Cost],Tab[Name No],Table2[Name No],Tab[Name],Table2[Name])

8.png

Best Regards,
Community Support Team _ Eason
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

4 REPLIES 4
Greg_Z
Regular Visitor

I wanted to add an easier solution if others are looking for a solution to the same issue.  The steps are listed based on the example provied (i.e. Table 1 and Table 2 in the screen shot).

 

  1. Under the Model View make sure there is a link between Table 1 and Table 2
    1. In this case it would be Table 1.Name No = Table 2.Name No
    2. Greg_Z_0-1701208839260.png
  2. In Table 2 create a new measure using the SUM dax

Here is a link to an example workbook with the Table 1 and Table 2 data set for reference

 

 

v-easonf-msft
Community Support
Community Support

Hi,  @Anonymous 

You need to create a summarize table first (calcualted table)

Tab = SUMMARIZE(Table1,Table1[Name No],Table1[Name],"Cost",SUM(Table1[Costs]))

Tehn using lookupvalue to create a calculated column.

C_Costs = LOOKUPVALUE(Tab[Cost],Tab[Name No],Table2[Name No],Tab[Name],Table2[Name])

8.png

Best Regards,
Community Support Team _ Eason
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thank you, this was really helpful

parry2k
Super User
Super User

@Anonymous you should create a table for name dimension with unique values for the name and set relationship with both the tables, it will be one to many relationships, in visual, use name information from this new table and rest of the columns from the respective table. This is the right way to do this. Read this post

 

Understand star schema and the importance for Power BI - Power BI | Microsoft Docs

 

Follow us on LinkedIn

 

Check my latest blog post The Power of Using Calculation Groups with Inactive Relationships (Part 1) (perytus.com) I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

 

Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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