Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
bartvandervurst
Regular Visitor

How to remove the default 'deduplication' from R Custom visual

Hi,


PowerBI has R Custom visuals to allow R programmers to create their graphs/efforts within PowerBI. 

While I'm trying to do so, I notice that the default code (which we can't change) is that we load the data into a data.frame & then deduplicate the data (see screenshot and the code line "unique(dataset)").

 

 

The latter (i.e. deduplication) is causing limitations to what you can do with this R visual: e.g. you can't create a histogram (cause all duplicates would have been removed), you can't create a proper Decision tree (as again all duplicates would be removed and the tree would be biased).

 

Can we remove the deduplication from the R Custom visual core code & make it 'optional'? Any way I can bypass this deduplication in the meantime.

 

PS: As a result of this deduplication, the decision tree results achieved by the custom visual 'Decision Tree' are wrong. This is how I actually came to found out.. 

 

Am I overlooking something?

4 REPLIES 4
Booth070
Frequent Visitor

Until they go along with the idea of taking that out, what I am doing is creating an ID column which runs from 1 to nrow of the dataset and importing that into R as well. That makes all rows different so none gets deleted, and you can delete the dummy column in R and use your normal code.

Greg_Deckler
Super User
Super User

I have actually posted an Idea on this here:

https://ideas.powerbi.com/forums/265200-power-bi-ideas/suggestions/13505508--r-don-t-remove-duplicat...

 

It is Under Review, please vote for it.

 

The only work-a-round that I have is to ignore the dataframe that is automatically created and load the data from the source into my own dataframe within the R code itself. Not optimal at all


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

Hi @Greg_Deckler,

 

Could you elaborate a little more on how you manually load data that is within your Data tab in power BI as a new data frame in the R script? 

+3 votes for your idea 🙂

Blog: sqlkover.com

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.