Forum Discussion

aghajanyanboris's avatar
aghajanyanboris
Regular Visitor
3 years ago
Solved

"parent -child" connection

Hi all!

There are two related tables. How to sum a column (table "many") and put in a column ("one") according to the associated key. If anyone can give me some advice, I'd be grateful!

 

Best Regards,

Boris Aghajanyan

4 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi aghajanyanboris ,

     

    You may consider using a merge query.

    and select Aggregate when expanding.

     

    Best Regards,
    Gao

    Community Support Team

     

    If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

    How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

    • aghajanyanboris's avatar
      aghajanyanboris
      Regular Visitor

      Dear GAO. Thanks a lot for the solution.
      I will try to describe the task in more detail: I have two tables. The first table ("Sales Summary Table") contains the fields: "product name" or "product ID", "total quantity sold"). The second table ("Sales") contains the fields: "product name or "product ID", "quantity sold". In the first table, each product is listed only once, in the second table: there can be several rows for each product (many sales). One in a word relationship: First table ("1") to second table ("many") I need to sum up the quantity for each product in the second table for each product (field "quantity sold") and put this value in the first table in the column "Total quantity sold" for the respective (related) product.
      I would be grateful for your advice.
      Sincerely,
      Boris