Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Relationship Problem and filter direction

Hi,

we have the attributes as Employee,Sales,Product,Country and the relationship between them as follows. we are facting filter problems in the following relationsip .The problem is we were un able to create any relationship between product and country (which is shown in dotted line) 

  • Hi Anonymous ,

     

    It's impossible to create relationship as below:

    Because if you do this, there are two relationship lines between the Sales table and the Country table. This is not allowed, and only one relationship can exist between the two tables.

    In fact, how you establish relationships between tables depends on how you want to create the visualization.

     

    Best regards,
    Lionel Chen

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

3 Replies

  • Greg_Deckler's avatar
    Greg_Deckler
    Community Champion

    Right, because then you would have two pathways between Country and Sales. These sorts of things are difficult to troubleshoot because they are data modeling issues and we can only surmise what your data looks like unless you post sample data. Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490.

     

    That being said, you can create the relationship, it will be inactive. But, you can use USERELATIONSHIP in measures and columns to tell DAX which relationship to use.

  • Mariusz's avatar
    Mariusz
    Community Champion

    Hi Anonymous 

     

    You can duplicate your Country table or invoke the inactive relationship using USERELATIONSHIP function.

    https://dax.guide/userelationship/

     

    You probably want to swap you bidirectional relationship as well to one direction.

    https://www.sqlbi.com/articles/bidirectional-relationships-and-ambiguity-in-dax/

     

    Best Regards,
    Mariusz

    If this post helps, then please consider Accepting it as the solution.

    Please feel free to connect with me.
    LinkedIn

     

     

  • v-lionel-msft's avatar
    v-lionel-msft
    Community Support

    Hi Anonymous ,

     

    It's impossible to create relationship as below:

    Because if you do this, there are two relationship lines between the Sales table and the Country table. This is not allowed, and only one relationship can exist between the two tables.

    In fact, how you establish relationships between tables depends on how you want to create the visualization.

     

    Best regards,
    Lionel Chen

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