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
leo3690
Regular Visitor

Creating Relationship Question

This seems to be super simple but for some reason I am getting an error message that says I can't create a relationship between these two columns becasue one of the columns mush have a unique values.  I am trying to use PEN ID as the join criteria.  Any help would be appreciated.

 

Here is what I have in my two tables.

 

Pen Table:

Pen IDPEN
50011
50022
50033
50044
50055
50066
50077
50088
50099
501010
501112
501214
501316
501418
501520
501621
501723
501824
501999

 

 

FFAPOC Table:  There are other columns but they are not relevant to the relationship.

DATEPen IDPEN
09/26/2016501621
09/26/2016501723
09/27/2016501621
09/27/2016501723
09/28/2016501621
09/28/2016501723
09/29/2016501999
09/29/2016501621
09/29/2016501723
09/30/2016501999

 

 

relationship.jpg

 

 

 

 

1 ACCEPTED SOLUTION

Great, will you accept this as a solution?





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!




View solution in original post

3 REPLIES 3
vanessafvg
Super User
Super User

one of the tables in the relationship must have unique  values, i.e FFAPOC should be the many side and the pen should be on the one side i am assuming?  you therefore need to clear out the duplicates of pen.

 

the best way to check if you have duplicates is to create 2 measures on the table

 

no of rows = countrows(pen)

count unique values  = distinctcount('pen'[pen])

if those 2 numbers are the same then you good if you have more rows than unique values you have duplication going on

stick them on a matrix and sort by nowofrows to find offending pen

 

also if you have any blank fields in pen that will also create an issue, pad those values with a -1  (something that has no business value)

 

 





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!




@vanessafvg Thank you so much.  Looks like PowerBi was seeing the blanks as nulls and counting those.  This little trick was awesome and was able to create the relationships. 

Great, will you accept this as a solution?





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!




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.