Forum Discussion

Rajiv1237's avatar
Rajiv1237
Icon for Resolver I rankResolver I
8 years ago
Solved

Many to Many Relationship between tables and show data in single Visualization - Power BI

Scenerio: I have two tables Table 1: ProductionCollection - It has product and collection amount. Product can repeat Table 2: ProductSales - It has product and sales amount. Product can repeat.  ...
  • Rajiv1237's avatar
    8 years ago

    We cannot connect Table1: ProductSales and Table2: ProductCollection directly because of many to many relationship. 

    Created a bridge table Table3: Product - that has distinct value of product from both tables.

     

    Table3: Product table creation

    Product = DISTINCT(UNION(DISTINCT(ProductCollection[ProductName]), DISTINCT(ProductSales[ProductName])))

    Product = DISTINCT(UNION(DISTINCT(ProductCollection[ProductName]), DISTINCT(ProductSales[ProductName])))