Forum Discussion

eniX's avatar
eniX
Helper III
8 years ago
Solved

Remove Duplicates & Relationsship bug?

Hi guys,

 

I have two tables t1 and t2. They are related through column r. In t2 the values in column r are distinct, in t1 they are not. I applied the function "Remove Duplicates" (aka Table.Distinct()) on t1.r (not on the whole table), but I still can't establish a 1:1 relationship between these tables: "The cardinality you selected isn't valid for this relationship". I counted the rows and the data shrinked. I also tried to group the table by r and count the group rows - there is no group with more than 1 row...Finally I tried to recreate this scenario with dummy data and it works like it should. 

Is it possible that Power BI doesn't update the meta data and thus thinks the values in t1 are still not distinct?

My data is coming from a SQL Server (import mode).

14 Replies

  • WolfBiber's avatar
    WolfBiber
    Microsoft Employee

    Do you have NULL and Empty Values in this column? 

     

    • eniX's avatar
      eniX
      Helper III

      No sir.

       

      In the meantime I loaded the data into jupyter notebook and preprocessed it there. I loaded transformed data into Power BI and tried to establish a relationship - it's still n:1...So the problem seems not to arise from using the "Remove Duplicate" function. Still have no clue :/