Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

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:
  • v-easonf-msft's avatar
    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.