Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Reference another table that's Many to Many (New Column)

Hi everyone,   I have two tables that have a many-to-many relationship between them. I want to create a new column that references both sheets.   A bridge table will not work for my scenario. I w...
  • Anonymous's avatar
    Anonymous
    5 years ago

    Hi Anonymous ,

     

    If you are creating a calculated column, it will be a bit complicated, please see the example

     

    Table

    Table(2)

    Relationship

     

     

    Sum in Table(2) by Name = CALCULATE(SUM('Table (2)'[Value]),FILTER('Table (2)',[Value]=[Value]))

     

     

     

    Sum in Table by Name = CALCULATE(SUM('Table'[Value]),ALLEXCEPT('Table','Table'[Name]))

     

    Now you can compare the value

     

    Column = IF([Sum in Table by Name]=[Sum in Table(2) by Name],1,0)

     

     

     

    If you could, you can merge your tables in Power Query.

     

    Or if you're still confused, please provide some dummy data and the expected results.

     

    Best Regards,

    Stephen Tao

     

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