Forum Discussion

RobertGilbert's avatar
RobertGilbert
Regular Visitor
7 years ago
Solved

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?

  • Anonymous's avatar
    Anonymous
    7 years ago

    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

6 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    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?

    • RobertGilbert's avatar
      RobertGilbert
      Regular Visitor

      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.

      • Anonymous's avatar
        Anonymous
        Not applicable

        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.