cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Lulaz
Regular Visitor

Cannot create relationship between two columns.

Hi,

 

I have two Excel tables, one with the master data and one with translations for rule violations.

 

In Excel 1, I have a colume that lists the error causeing the load violation in each individual report uploaded to a repository. These might be repeated throughout the report as one upload might have an error 'WMAC03_IM_CR_MSEG_LIFNR' occuring 25 times in the file. A separate report might have that error 62 times and so on.

 

I then have Excel 2 listing the 'English' translation of these errors. eg. 'WMAC03_IM_CR_MSEG_LIFNR' is translated to 'Assign the correct Vendor number to this cell.' in both files I have RULE_NAME as the error code listed.

 

In my dashboard, I want BI to show the 'English' Translation if it sees a certain error listed.

 

I have tried to link these two files but I get 'You Can't create a Relationship between these two columns bacause one of the columns must have Unique values'. I have double / tripple checked, removed duplcates from the excel and ran a quirie in BI to remove duplicates from the RULE_NAME feild in Excel 2 and none are there. So the Excel 2 is made of uniquie values in Colume 1. There is also no blanks or Nulls I can see.

 

Any Ideas how i can link the two feilds?

 

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
Super User III
Super User III

Re: Cannot create relationship between two columns.

Hm, that's a bit strange.

Then trim and clean the column (s in both tables) as well - before removing duplicates. You find these commands under the lowercase.

Imke Feldmann (The BIccountant)

If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!

How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries

View solution in original post

14 REPLIES 14
Super User I
Super User I

Re: Cannot create relationship between two columns.

could you have the same rules but in different cases?  i am assuming you did the remove duplicates in Power Query?  I think power query is case sensitive, however i could be wrong.. but its just a thought.


Did I answer your question? Mark my post as a solution.
Proud a to be a Datanaut!
Lulaz
Regular Visitor

Re: Cannot create relationship between two columns.

Yes, good thought, but takeing a look through, some do occur in lower cases, but are still unique.

 

The first few Characters in the string though are not unique, eg, QTIC06_CR_KONA_BOART + QTIC06_CR_KONA_KBETR + QTIC06_CR_KONA_KBRUE. Is there a limit on the lookup string value? So when judging if something is unique, its only looking at first 5 or 10 characters?

Super User I
Super User I

Re: Cannot create relationship between two columns.

no i wouldn't think so.  have you done a group by on the table with a count to double check there no duplicates?


Did I answer your question? Mark my post as a solution.
Proud a to be a Datanaut!
Lulaz
Regular Visitor

Re: Cannot create relationship between two columns.

Tried that just now (I hadn't before) and yep, no duplicates. 

 

Power BI Duplicate check.JPG

Super User I
Super User I

Re: Cannot create relationship between two columns.

and the data types are the same?


Did I answer your question? Mark my post as a solution.
Proud a to be a Datanaut!
Lulaz
Regular Visitor

Re: Cannot create relationship between two columns.

Yep, Both Text.

Super User III
Super User III

Re: Cannot create relationship between two columns.

The query editor is case sensitive while the data model isn't.

So in order to be on the safe side here, I'd recommend to:

1) tranform both key column to lowercase (or uppercase)

2) then remove dups again

Imke Feldmann (The BIccountant)

If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!

How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries

Highlighted
Lulaz
Regular Visitor

Re: Cannot create relationship between two columns.

Okay, great,

 

Is there a quck way of doing that? There is over 1600 values.

Super User III
Super User III

Re: Cannot create relationship between two columns.

Sure, that's what the query-editor is meant for:. Check the column, and then:

 

1) lowercase

 

PBI_Lowercase.jpg

 

2) remove dups

 

PBI_Remove_Dups.jpg

 

 

Imke Feldmann (The BIccountant)

If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!

How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries

Helpful resources

Announcements
Announcing the New Spanish Forum

Announcing the New Spanish Forum

Do you need help in Spanish? Check out our new Spanish community section.

April 2020 Community Highlights

April 2020 Community Highlights

Info on our Super Users, MBAS content and badges, and updates to our support articles. - Read the full Community Highlights.

MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

Top Solution Authors
Top Kudoed Authors