Forum Discussion
tables
I am pretty new to PowerBI and to dealing with writing Query's so please be a little patient with me.
I have read many of the articles about getting the relationship between two tables to work correctly. Here is my issue I constantly get "you can't create a relationship between these two columns because one of the columns must have unique values."
well I have done the following. I have already created additional columns in each of my two tables and concatenated two different columns so each have different data, and still same error.
One table is from my SQL server and the other Table I am pulling from Active Directory. so the information has nothing in common. I am creating a custom column in each that creates a specific number depending on "Vendorname" or "Department" This I was hoping would allow me to just sort vendors and departments accordingly. But nope this never worked.
so I am now lost after many, many hours of searching and trying everything I could think of or read.
Your help in this would be greatly appreciated.
so our rows will never be the same since we will have more in one table than the other.
the table hopefully
1 Reply
- Greg_DecklerCommunity Champion
The data that you show below shows duplicate values in your "KeyData" columns, the first two rows have "1Viewpoint Construction Software" as well as the last two rows "4Oracle". Similar story in your other table. Therefore, you do not have unique values in either of your KeyData columns. For this to work, you would need to have only a single instance of "1Viewpoint Construction Software" and "4Oracle" in your table. In other words, those values would need to appear on one row and only one row.
I am unclear given your description as to why you are attempting to relate two columns that you say have no relationship to one another. You also say that you are trying to get them to sort correctly. You'll have to explain this a little more, I'm not getting it. But, if you want a single list of all Vendors and Departments that are unique, you could create 3 more queries. First one would just pull Vendorname from your first source. The second would just pull Department from your second source. Then, you would create an Append query to append these two queries together and then do a "Remove duplicates" as part of this Append query. Then you would have a table of all unique values for both Vendors and Departments that you could then relate to your two tables below.