Forum Discussion

powerbiexpert22's avatar
powerbiexpert22
Icon for Impactful Individual rankImpactful Individual
1 year ago
Solved

many to many

i am working on building semantic model where i encountered many to many between case and product table as shown below, this is valid relationship between case and product tables, source for power bi...
  • Kedar_Pande's avatar
    1 year ago

    powerbiexpert22 

    Handling many-to-many relationships directly in Snowflake without creating a bridge table in Power BI is indeed possible.

    • Even though you don't want to create a bridge table in Power BI, you can still create it in Snowflake. This table will store the relationships between your CASE and PRODUCT tables.
      CREATE TABLE CASE_PRODUCT (

      CASE_ID NUMBER REFERENCES CASE(CASE_ID),

      PRODUCT_ID NUMBER REFERENCES PRODUCT(PRODUCT_ID)

      );
    • When querying the data in Power BI, you can join the CASE and PRODUCT tables using the bridge table.