Forum Discussion
Anonymous
6 years agoNot applicable
Set existing column as Primary key (index)
How do we set up existing column in a given table within the model as a primary key? Note that we do not want/need to create an additional index column. We want to tell the model: this column is ...
PaulDBrown
Community Champion
6 years agoAnonymous
1) create a new table (modeling tab in ribbon / New table) with distinct values for the column you wish as primary key:
Primary Key = CALCULATETABLE(VALUES(Table1[Column (PK)]); Table1; NOT(ISBLANK(Table1[Column (PK)])))
2) join this new table to the orginal by joining the corresponding columns in a single-to-many relationship
3) use this new table Values with "Primary Key" in all your expressions in measures, visuals, filters, slicers...