Forum Discussion
Manage Data Relationships
Hi Everyone,
I am new to PowerBi and I am trying to create a relationship between two fields and I am getting the error "you can't create a relationship between these 2 columns because one of the columns must have unique values". Both Fields have county specific data that I want to be able to report off of. Some of the "County" data in one sheet is blank so I have it set to other and the other one it is filled out completely. However, one report does have more counties present that I have on other report. I am wondering if all these things are causing issues in the report recognizing the two fields as equal. I would ideally like for it not to try to find a relationship for any of the fields that I do not have in one or the other dataset. I hope this makes sense! Thanks in advance for your assistance.
2 Replies
- ukeasyproj
Helper II
it seems like you are trying to create a many-to-many relationship in Power bi which is not allowed
you can only do one-to-many, many - to - one, or one-to-one
- CahabaData
Memorable Member
to elaborate: one of the columns must have unique values
if your data sets don't give you that, then you must create that table as part of the Query Editor transform processes. Let's say you have 2 data sets - Sales and Products - and they both repeat the field Color many times i.e. there are many Products in red and many sales of red products. You need a distinct list of just colors where no color repeats. Hopefully this makes sense just made it up off the cuff.
In the Query Editor you can create a Color table off one of these data sets so it only contains a distinct list.