Forum Discussion
Set existing column as Primary key (index)
Hi Anonymous ,
Interesting question. AFAIK, there's no such feature in Power BI.
As you said we can create index column or remove empty/duplicate rows in Power BI, I'm not sure where we can use primary key.
BTW, we can do few operations on rows in Power BI.
Best Regards,
Jay
Community Support Team _ Jay Wang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
"AFAIK, there's no such feature in Power BI"
And how on Earth this tool got at the top of Gartner?..
- Anonymous6 years agoNot applicable
Hi Anonymous ,
Please check this document.
https://docs.microsoft.com/en-us/power-bi/desktop-what-is-desktop.
Power BI Desktop is a free application you install on your local computer that lets you connect to, transform, and visualize your data.
The most common uses for Power BI Desktop are as follows:
- Connect to data
- Transform and clean that data, to create a data model
- Create visuals, such as charts or graphs, that provide visual representations of the data
- Create reports that are collections of visuals, on one or more report pages
- Share reports with others by using the Power BI service
"We want to tell the model: this column is primary key, therefore applying usual PK restrictions to it - value cannot be null and there may not be rows with duplicate values."
I'm not sure why you want to set an exist column as primary key since you can't insert rows in Power BI as you can do in database. Or you just want to delete empty/duplicate rows by one click?
There's no such feature that you can select a column then click the button to set the column as primary key. You can submit your idea through the below link.
https://ideas.powerbi.com/forums/265200-power-bi-ideas.
Best Regards,
Jay
Community Support Team _ Jay Wang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- Anonymous6 years agoNot applicable
"I'm not sure why you want to set an exist column as primary key"
Because I want to configure the column - and hence set the rules around data in this table - with the rules that define any PK: no null values, no duplicate values. Because otherwise I wouldn't be able to implement certain configuration involving this column - PBI won't allow it if the data is not unique and/or contains nulls.- Anonymous6 years agoNot applicable
Hi Anonymous ,
Understand. Let's say you have a column named id with values (1,2,3) and you want a feature that can set the column as primary key. Once you use like replace value feature to replace "1" to "2", it will pop-up error message and forbid your operation.
As far as I know, there is no such feature currently and you need to submit your idea through the link above.
Best Regards,
Jay
Community Support Team _ Jay Wang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.