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
DarylM
Helper II
Helper II

Can't create a relationship between two columns

Hi, I am having trouble creating a relationship betwene two tables. 

One table has a unique customer number and name along with customer details like address, phone, etc. 

The other table with sales transactions for products. There are multiple lines for each item a customer purchased. 

 

I feel the customer number columns should create the relationship as as a one to many, but it does not work. 

 

Any thoughts?Capture.JPG

1 ACCEPTED SOLUTION
KHorseman
Community Champion
Community Champion

Somehow you must have ended up with at least one duplicate in the customer table. You can either use the Remove Duplicates option in the query editor, or perhaps you can hunt down the duplicate and fix it at the source. The easiest way to find the duplicate is to create a measure to count the customer ID column, then drop that column and that measure on a table visual, sort by the measure and see which ones come up more than 1.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

5 REPLIES 5
KHorseman
Community Champion
Community Champion

Somehow you must have ended up with at least one duplicate in the customer table. You can either use the Remove Duplicates option in the query editor, or perhaps you can hunt down the duplicate and fix it at the source. The easiest way to find the duplicate is to create a measure to count the customer ID column, then drop that column and that measure on a table visual, sort by the measure and see which ones come up more than 1.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




edwardrmiles
Helper III
Helper III

is Sold to Number in Customer Setup Report definitely unique?

 

You can check in the data view. Select the column and it gives you a row count and a distinct values count

 

Yeah. There are 10,650 distinct account numbers. These are all the company account records. I am trying to create filter that I can search by zip or city and populate customers what they have purchased. 

 

The customer setup report is account details and the other individual line by line transactions. 

@DarylM I presume then there are 10,650 rows too?

You suggestion worked. I thought I removed all the duplicates, but there were a few. I removed them in the editor. 

Then I create a calculated column by blending the customer number with the zip code. Then the tables linked. Thanks for your help!

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.