Forum Discussion

Syndicate_Admin's avatar
Syndicate_Admin
Icon for Administrator rankAdministrator
4 years ago
Solved

POWERBI: Join tables through the same column

I have two tables with the same columns and I want to make a union between them, so that I get a table in which I have only the products_id that match each other.

Simplifying my case and omitting the rest of the columns:

TABLE 1

Product_id

1

2

2

2

TABLE 2

Product_id

1

1

3

4

The result I want to achieve in this case would be as follows:

TOTAL TABLE

Product_id

1

1

1

2

2

2

I have tried to use the FUNCTIONS of UNION and INTERSECT, but with none I have obtained the result I expected. I'm new to DAX language so I may have done it wrong. Thanks a lot!!

  • Hey,

     

    Based on your example, this function should provide the desired result:

    TOTAL TABLE =
    UNION ( TABLE1, INTERSECT ( TABLE2, TABLE1 ) )

     

    Result: