Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

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

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
vanessafvg
Super User
Super User

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.





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




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?

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





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




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

 

Power BI Duplicate check.JPG

and the data types are the same?





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




Yep, Both Text.

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

Lulaz
Regular Visitor

Okay, great,

 

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

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

Lulaz
Regular Visitor

Thank you ImkeF, 

 

Compleated that, converted everything to Uppercase in both tables and removed duplicated in Column 1 in Excel 2 'RULE_NAME', still no luck in getting them to connect.

Lulaz
Regular Visitor

Would it matter if a value in Column 1 is also in Column 2 of Excel 2? Not all the rules have a translation, so the rule is just repeated in the translation column. If I remove them might that help?

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

Lulaz
Regular Visitor

Trim and Clean worked! 

 

Thank you so much, this has been driving me demented for weeks! 

 

Now to just get it to pull the english value and I'm all set!

 

Thank you ImkeF!

That's good!

So what happened here is that your unique values-to-be haven't been unique, but contained either blanks (trim) or non-printable characters (clean).

So you've lost some rows in your lookup-table here and might have to check if this causes problems now. What remove duplicates does is to keep the first row it finds. 

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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.