Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Calculate Sum from another table for matching values

I have 2 tables. One with people and payments. The other with a couple selected names that I want sums for. I need this as a table.

 

table1

name amount

bob 10

joe 5

mike 7

bob 5

mike 2

 

table2

name amount

bob 15

mike 9

 

I think I need something like this:

[table2]amount = calculate( sum( 'table1'[amount]) , 'table1'(name) = 'table2'(name) )

 

I asked a similar question here, but if I calculate it this way, the numbers on my page won't change with the filters I display.

https://community.powerbi.com/t5/Desktop/Need-Table-equivalent-of-SELECT-name-sum-amount-from-Table-group/m-p/758343#M365466

  • dax's avatar
    dax
    7 years ago

    Hi bshimamoto, 

    You don't need to create sum measure, when add it to table, it will sum automatically

    If you want to use another table(table2) in filter, you need to make sure there is a realtionship between two tables, then it will work.

    Best Regards,
    Zoe Zhi

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

2 Replies

    • dax's avatar
      dax
      Icon for Community Support rankCommunity Support

      Hi bshimamoto, 

      You don't need to create sum measure, when add it to table, it will sum automatically

      If you want to use another table(table2) in filter, you need to make sure there is a realtionship between two tables, then it will work.

      Best Regards,
      Zoe Zhi

      If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.