Reputation: 688
I haven't seen this before in R, but in the book 'Advanced Analytics in Power BI with R and Python', the author says:
Why do they have to be unique? how is it enforced?
Upvotes: 2
Views: 43
Reputation: 690
This applies to the very specific combination of R and Powerbi (when you run R from within Powerbi), when you open the R code viewer in Powerbi you will see the following:
# Create dataframe
dataset <- data.frame(...)
# Remove duplicated rows
dataset <- unique(dataset)
The above part cannot be modified! If you want to use all rows as they are, you have to include a unique identifier (i.e. a primary key) for the dataset, even if you don't have any other particular use for it as part of the visual.
For reference see this Microsoft doc, section "Create R visuals in Power BI Desktop", paragraph 4
Upvotes: 2