Forum Discussion
SophieBoucher
10 years agoFrequent Visitor
change primary key power bi
Hello, Anyone can tell me how we can change a colomn of Primary key in Power BI, I have a table with 2 Colomn, i like to add an Index colomn and specify it to primary can, i can't do it. Tha...
Smizmar
8 years agoRegular Visitor
In Query Editor:
1. Do your Unpivoting work.
2. Add Column; Index Column; From 0 or 1. Call it Index.
3. Create a copy of the column that the editor thinks is your primary key. Call it "Primary - Copy".
4. Delete the column that the editor thinks is your primary key (so delete "Primary" column in this example.) This will force the editor to assume a different primary key. It will choose the Index column as your new primary key.
5. Apply your changes.
6. Go back and rename the "Primary - Copy" to its orignial name.
CarlosCuenca
7 years agoNew Member
It works but instead of duplicate the column I deleted it, created the index column, refresh the model and them erase the step of deleting. All in the Query Editor.