Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago

Data Modeling of Geographic Table

I am trying to relate two tables in power bi that contain geographic information and keep getting a many-to-many relationship. Is there a way to bypass this? The two table samples are included; 

StateRegionCityConcerts
DelawareRegion 2Dover20
New YorkRegion 1Manhattan43
TexasRegion 4Dallas68
TexasRegion 4Houston98

 

Table 2

StateRegionCityProtests
AlaskaRegion 5Dillingham34
AlabamaRegion 2Mobile72
IllinoisRegion 3Chicago87
New YorkRegion 1Bronx56
TexasRegion 4Dallas59

4 Replies

  • NaveenGandhi's avatar
    NaveenGandhi
    Icon for Memorable Member rankMemorable Member

    Hello Anonymous 

    You can try concating state, region, city in both tables and see if you get a distinct values similar to row count in any one of the table.

     

    That should do the trick. Let me know if this helps!

    If this post helps, then please consider Accept it as the solution to help the others find it more quickly. Appreciate you kudos!!

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thank you for your response. When I do that, I still get a many-to-many relationship. 

  • NaveenGandhi's avatar
    NaveenGandhi
    Icon for Memorable Member rankMemorable Member

    Anonymous 

    Can you share your data or PBIX after removing sensitive information?

    That will be useful to help on this further. if not see which are the duplicate keys in both tables and try to work on making them unique as well.



    • Anonymous's avatar
      Anonymous
      Not applicable

      Unfortunately, I can't. I was however able to solve this by creating a bridge table that had just city and state information with no duplicates.