Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Cannot create relationship between one calculated table and two tables from Power BI dataset

Hi,

I have trouble creating a relationship.

I have 2 fact tables from the same data source (a Power BI dataset).

I also have one dimension table, which is a calculated table joining (with UNION()) select columns from three tables. Two of the tables come from the same data source as the fact tables. The third one comes from a different Power BI dataset.

 

dim_products_append = 

var table1  = SELECTCOLUMNS(dim_products, "ProductID", dim_products[ProductID], "Brandname", dim_products[Brandname])

var table2 = SELECTCOLUMNS(dim_dropship_pipeline, "ProductID", dim_dropship_pipeline[ProductID], "Brandname", dim_dropship_pipeline[Brand])

var table3 = SELECTCOLUMNS(dim_tool_pipeline, "ProductID", dim_tool_pipeline[ProductID], "Brandname", dim_tool_pipeline[Brand])

return union(table1, table2, table3)

 

If would like to create relationships from the dim table to the fact tables between ProductID for one of the fact tables, and Brand/Brandname for the other.

I'm only able to create one though. When I try to create the other I get a message that a relationship already exists outside of the data source. I don't understand how that's possible. 

 

I'm the one who made the Power BI dataset with the fact tables and I can confirm that there are no relationships between fact_dropship_pipeline and fact_tool_pipeline. Could it have something to do with my dim_products_append definition?

I hope someone has a solution ðŸ¤“

  • KBO's avatar
    KBO
    4 years ago

    Hi Anonymous ,

    If I understand it rigth you have a Dataset based on two other Datasets or a otherDataset and another source? 

    It's not possible to have more than one relationship in Composite Models between other Datasets (sources). 

    You can put all the Datasources in one Dataset and connect them there but otherwise I gues this won't work. If I understand your problem right :).

     

    Best,

    Kathrin

     

     

     

     

    If this post has helped you, please give it a thumbs up!
    Did I answer your question? Mark my post as a solution!

3 Replies

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi Kathrin,

       

      Thanks for the reply. I took a look and I don't think it says anywhere that I shouldn't be able to create the relationship, or have I just missed it?

      • KBO's avatar
        KBO
        Memorable Member

        Hi Anonymous ,

        If I understand it rigth you have a Dataset based on two other Datasets or a otherDataset and another source? 

        It's not possible to have more than one relationship in Composite Models between other Datasets (sources). 

        You can put all the Datasources in one Dataset and connect them there but otherwise I gues this won't work. If I understand your problem right :).

         

        Best,

        Kathrin

         

         

         

         

        If this post has helped you, please give it a thumbs up!
        Did I answer your question? Mark my post as a solution!