cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
RobertGilbert Frequent Visitor
Frequent Visitor

Table Joins

I have a table of unique values (combined key of customer and material), no other values in that table. I have sales table with that key also, but obviously not unique.  There are about 12 million rows of sales data and 3 million unique entries in my customer/material table.  When trying to, join, I get the message that at least one table must have unique values.  I have validated multiple times, and the customer/material entries are unique.  What is happening?

1 ACCEPTED SOLUTION

Accepted Solutions
rajendran Super Contributor
Super Contributor

Re: Table Joins

Hi @RobertGilbert

 

I understand you are sure that the values in dim table is unique. Can you try create a new calculated table and try joining this with your fact table for testing purpose? ( Go to Modelling -> New Table-> Use this formula)

 

Table =
FILTER (
    DISTINCT (
        SELECTCOLUMNS ( CustomerTable, KeyColumn, CustomerTable[KeyColumn]  )
    ),
    ISBLANK ( CustomerTable[KeyColumn]) = FALSE ()
)

 

Thanks
Raj

View solution in original post

6 REPLIES 6
clokeshreddy Regular Visitor
Regular Visitor

Re: Table Joins

Hi @RobertGilbert,

there seems a duplicate values of the combined key in your dimension table.

While loading can you try loading select distinct combinedkey from dimensiontable  and see if you still get this error?

Highlighted
RobertGilbert Frequent Visitor
Frequent Visitor

Re: Table Joins

I am not understanding how to 'select distinct combinedkey'.  I have one field in the file, which already has key combined, prior to uploading file to Power BI.  I have tried 'Remove Duplicates' and that does not help.  If there were duplicates for the key, since the key is the only field in that file, it should resolve.  After getting this to work, I plan to add 2 more columns which split the key.

clokeshreddy Regular Visitor
Regular Visitor

Re: Table Joins

it seems you said you have a table of unique values with combinedkey and when you are loading the table can you load the distinct records using the SQL?

if you cant figure it out try uploading the dimension table data in here to get a better help.

RobertGilbert Frequent Visitor
Frequent Visitor

Re: Table Joins

I believe you are still not quite understanding me.  I know that the customer/material file, which contains 1 field is unique.  There are 3,356,863 entries in this file.  I am trying to join it with our sales data file, which has the same key and has about 12,000,000 entries.  Now, you may ask why combine a file with one field to another file which contains that same field.  The truth is, there should be other fields in the customer/material file, however, until I can get this combine issue resolved, I am not placing them there.

rajendran Super Contributor
Super Contributor

Re: Table Joins

Hi @RobertGilbert

 

I understand you are sure that the values in dim table is unique. Can you try create a new calculated table and try joining this with your fact table for testing purpose? ( Go to Modelling -> New Table-> Use this formula)

 

Table =
FILTER (
    DISTINCT (
        SELECTCOLUMNS ( CustomerTable, KeyColumn, CustomerTable[KeyColumn]  )
    ),
    ISBLANK ( CustomerTable[KeyColumn]) = FALSE ()
)

 

Thanks
Raj

View solution in original post

RobertGilbert Frequent Visitor
Frequent Visitor

Re: Table Joins

Rajen,  This process worked, and also uncovered the underlying issue.  I have many entries that are 'near' duplicates.  Where the first character is a 'space' or not, and the rest is the same, example " 12345" and "12345".  Now, even doing a 'trim' and 'remove duplicates' did not resolve, however your neat DAX trick below with creating new tables did.  I was given the clue as to what the issue was, when I saw that these records were missing, so now only "12345" rather than both.

 

Thanks Much

Bob Gilbert

Helpful resources

Announcements
Ask Amir Anything

Exclusive LIVE Community Event No. 2 – Ask Amir Anything

Next in our Triple A series: Ask Amir Netz questions about the latest updates, features and future.

October 2019 Community Highlights

October 2019 Community Highlights

October was a busy month in the community. Read the recap article to learn about some of the events and content.

New Solution Badges

New Solution Badges

Two waves of brand new solution badges are coming! Read the article for more information on our new community badges.

Analytics in Azure virtual event

Analytics in Azure virtual event

Experience a limitless analytics service built to ingest, prep, manage, and serve data for immediate use in Power BI.

Users Online
Currently online: 352 members 3,525 guests
Please welcome our newest community members: