Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago

PowerBI data modeling issues- 1-Many Relationships

Hello PowerBI community,

 

@Amit@Greg , @tamerj1 , @lbendlin 

 

 

 

@amitchandak , @olgad , @Sahir_Maharaj , @FreemanZ , @tamerj1 , @Greg_Deckler 

 

@christinepayton audreygerred 

 

 

I have Workcenter Code column in Table 1 and another Workcenter Code column in Table 2. Both Workcenter Code are in Text format under data type. I am trying to link Table 1 and Table 2 but PowerBI does not allow 1-1, 1-Many or Many-1 relationship. 

 

It has easily worked in other data tables before in the past but not this time. 

 

To resolve this issue, I made sure both have same data type, eliminated null values and did Transform-Trim & Transform-Clean.

 

Still, it did not allowed me to form the relationship between those 2 data tables so that I can start applying DAX coding etc..

 

Any help or insight here to resolve this issue will be appreciated.

 

Thanks. 

3 Replies

  • Greg_Deckler's avatar
    Greg_Deckler
    Community Champion

    Anonymous So it just flat-out doesn't create a relationship at all or it creates an inactive relationship? In the case of the latter, you have multiple paths between the two tables and you can use USERELATIONSHIP in measures to choose the relationship you want. In the case of the former, what is the error you are getting?

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hello Greg_Deckler,

       

      It says this cardinality is not valid for this relationship(1-1,1-Many & Many-1) which I know is valid. 

       

      Is it recommended to use Many-Many relationship?--This is the only cardinality it allows to create. 

       

      I have Planned Time column in Table 1 and Downtime column in Table 2.  I am trying to create a Measure inside a Measures Table where it calculates the difference between Planned Time and Downtime from 2 different tables and I am not able to do this because I cannot form a data modeling relationship between Table 1 and Table 2. 

       

      I tried using Related Function, SelectedValue and many other DAX codes, none of them is working. 

       

      Can you suggest how to resolve this issue?

       

      Thanks,

       

       

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous 

     

    Greg_Deckler  Thanks for your sharing !

     

    Your problem seems to be that you are unable to create a one-to-many relationship between two tables despite matching data types and performing data cleansing operations.


    You can try the following operation:

     

    Check if the values in the tables are unique values.

     

    For one to Many relationships, Power BI requires that the "one" end of the relationship contain unique values.

     

    desktop-create-and-manage-relationships

     

     If you’re working with composite models, there are limitations on creating relationships between tables from different datasets or sources.

     

    Solved: Cannot create relationship between one calculated ... - Microsoft Fabric Community

     

    Regards,

    Nono Chen

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