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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
tstackhouse
Helper III
Helper III

Relationship with Unique Value

I am trying to create a relationship between two tables. I have tried to do this and I have been receiving the error "cant create a relationship between these two columns because one of the columns must have unique values." I have removed duplicates in the query editor and I am still receiving this error. I have also tried to remove errors and neither seems to work.

 

Any suggestions??

1 ACCEPTED SOLUTION

@tstackhouse,

 

Enclose 1 with double quotes (").

Column =
IF ( [Master Column] = "", "1", [Master Column] )
Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

7 REPLIES 7
vanessafvg
Super User
Super User

@tstackhouse

 

1. are they all the same case?

2. do you have any blank values?

 

power query  sees different cases as unique values, dax doesn't.  hence remove duplicates no working

also if there are blanks on the side that should be unique you need to pad them with a value like unknown or -1 or something similar.





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!




I have one row that contains a blank value, How would I go  about padding this with a 1? I have tried to just create a new column by using:

=if([Master Column]="",1,[Master Column].

With this I am recieving an "Expressions that yield a varient data-type cannot be used to define calculated columns" error. 

@tstackhouse IF ( ISBLANK ( [Master Column] )1, [Master Column] )





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!




The formula returns the same error that I was returned previously for me.

@tstackhouse,

 

Enclose 1 with double quotes (").

Column =
IF ( [Master Column] = "", "1", [Master Column] )
Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thank you that one works for me!

I have one row that contains a blank value, How would I go  about padding this with a 1? I have tried to just create a new column by using:

=if([Master Column]="",1,[Master Column].

With this I am recieving an "Expressions that yield a varient data-type cannot be used to define calculated columns" error. 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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