Forum Discussion
Anonymous
5 years agoNot 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:
- 5 years ago
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])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.
Greg_Z
2 years agoRegular 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).
- Under the Model View make sure there is a link between Table 1 and Table 2
- In this case it would be Table 1.Name No = Table 2.Name No
- 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