Forum Discussion

heidibb's avatar
heidibb
Helper IV
10 years ago

Issues Creating a Relationship

Hello,

 

Please see my model in the image below. I am trying to create a relationship between a few of these tables and a WEEK table.

 

My WEEK table has one column for WEEK with the values of 1 through 10.

My other tables will have a week column for each row and I'd like to create relationships with my WEEK table to be able to pull data from a few of these tables into one view.

 

It is allowing me to do this once, but that is it. Not sure how to rectify this

 

7 Replies

  • As a follow-up. When I do try and create and make this relationship active, I get this message:

  • heidibb

    You can create another table with weeks.

    for example:

     

     

    Week 1| Week 2| Week 3|

      1        |    1       |     1     |

      2        |    2       |     2     |

      3        |    3       |     3     |

      4        |    4       |     4     |

      5        |    5       |     5     |

      6        |    6       |     6     |

      etc.

     

    Then you create a relationship between the different week columns.

     

    for the one above Week 1

    In the middle Week 2

    And the one below Week 3

     

    Regards,

    Jorre

    • heidibb's avatar
      heidibb
      Helper IV

      Thanks Jorre94. I thought that would solve it but I'm still getting the error stating that it would "introduce ambiguity between tables WEEK and BB_RPT FACULTY. To make this relationship active, deactivate or delete one of hte relationships between WEEK and BB_RPT FACULTY first."

  • CahabaData's avatar
    CahabaData
    Memorable Member

    Not all relationships need to exist at the Data View level.

     

    In a Measure one can use the RelatedTable function of a DAX expression in order to relate fields between tables as a condition of the expression it is performing.  You might want to search on this topic and review some examples.

     

     

    • heidibb's avatar
      heidibb
      Helper IV

      thank you CahabaData. I will search this, but my ultimate goal is to use week from my main WEEK table as a slicer to be able to filter my views that would include fields from multiple tables.

       

      For example, when my slicer is selecting week 1, it will show data below for WEEK 1 only

       

      WEEK                  |  ANNOUNCEMENT               |  FACULTY SCORE

      from week table  |  from announcement table     | from faculty table

                                     joined to week table                 joined to week table

       

       

      I hope this makes sense.

      • CahabaData's avatar
        CahabaData
        Memorable Member

        okay, now I can do what you seek in a simple trial; 2 separate tables each with a year column and then a stand alone Year table.  I join the Year table to the 2 tables and a single slicer using the Year table works on them both.

         

        but these 2 tables join nothing else; and I see from your error message it is referring to a join to another table.....   It is not clear whether there is perhaps a date field in that problem join also? in some way.....  while you could probably delete this problem join just to test the slicer functionality I imagine that causes other problems.....