Forum Discussion

nick9one1's avatar
nick9one1
Helper III
3 years ago
Solved

fixing a relationship

I have some related tables, and I'm trying to work out the best way to 'fix' a relationship issue.

going from left to right, A site has many categories, and each category has many items. 

 

 

 

In the initial table design 'categories' and 'site items' tables didnt have direct relationship

 

So in an attempt to fix I've created a custom column in the Site Items and Categories tables 

 

CombinedName = 'Categories'[Sites] &" - " & 'Categories'[Category]

 

 

Then I added a relationship. But the relationship is many to many, and it should be one to many. 

 

What is the best way to fix this?

 

 

  • I would stick with the 1st layout but use the CombinedName to join Categories to SiteItems.

     

    ie.

    Sites --> Categories --> SiteItems

     

    If you still unable to create a many-to-one relationship between Categories and SiteItems, it is probably a data issue.  (ie. SiteItems without a corresponding Category)

     

    I hope this helps.

     

2 Replies

  • I would stick with the 1st layout but use the CombinedName to join Categories to SiteItems.

     

    ie.

    Sites --> Categories --> SiteItems

     

    If you still unable to create a many-to-one relationship between Categories and SiteItems, it is probably a data issue.  (ie. SiteItems without a corresponding Category)

     

    I hope this helps.

     

  • Thanks, It was a data issue as you suggested. Found some blank rows in the table.