Forum Discussion
Relationship between two tables
Hi
Please if anyone can help me to make relationship between two tables as shown in the attached pictures , it is always give me messages as (many to many) but I need to be relationship (Many to one).
Thanks & Regards,,
7 Replies
- IdrissshatilaSuper User
Hello assemomar ,
it shows many to many since in both tables there are many values under the functional location id, if you want it to be many to one then you should have unique ids in the one table.
- assemomarFrequent Visitor
Dear Mr. Idressshatila
The column functionallocationID it is the unique , please if you could help me in picture how to solve it
- IdrissshatilaSuper User
in the month++ table, does the functionallocationID has duplicates ?? because as per the relationship many to many it shows that it has duplicates that's why it's showing many to many.
- assemomarFrequent Visitor
Dear Mr. Idressshatila
Yes the table : functionallocationID, has too much duplicate. It is big data more than 7500 rows.
so please how to make relationship be many to one
- IdrissshatilaSuper User
in order to be one to many, the table should have a distinct value of the id that you are making the relationship with.
in your case you should have a middle table with distinct functionallocationID that connect with both of these tables.
check the concept of star schema https://learn.microsoft.com/en-us/power-bi/guidance/star-schema
- Thennarasu_RResponsive Resident
assemomar
If have a Unique value in Month ++ table, It should come from one to many relationships. May be have Blank in your Month ++ table defanetaily it will come many to many relationship.Check your master table either blank or not.
Thanks,
Thennarasu R - assemomarFrequent Visitor
Dear Mr. Idressshatila
for your information when I add in table : months+++ (column month) only january it is working for relationship, but the problem when I add in table : months+++ January , February, March, April , then message : many to many relations appear
Could you please help me how to solve this