Forum Discussion
change primary key power bi
I've run into a similar problem. On a table from Azure SQL having a proper pirmary key.
Following (some of the) steps above did help. Initially... Unfortunately the problem reappeared when I changed the filters in Power Query. Even with a Table.ReplaceKeys. So I started removing the columns being wrongfully assumed to be PKs again. And with every column removed, another faulty column (further along in the table) was chosen as PK.
From that I concluded Power BI has a bit of a mind of it's own 😉 and needed to be tricked with it's onw logic.
So I tried reordering columns. First started with all the columns that relate to the dimension tables. And after that the first column was my 'real' PK. This did the trick for me. Even with all the other columns back in place. And it's actually quite a quick change to make.
Hopefully someone having the same issue will find this post and is also able to fix this annoying issue quite easily.