cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Syndicate_Admin
Administrator
Administrator

Problems using the R script visual

Dear Community,

I've been trying to use the R script visual in power BI to work with some R visualizations. I've watched over 3 videos to use these R scripts, but I have a basic problem that won't let me move forward.

In the image below you can see that I have uploaded 3 columns from a database to the R script, but these are not automatically loaded to the R script as is often the case in all the videos I have seen.

AlexisCab1602_0-1631192991544.png

this is an example of what should happen when you load the columns to the visual

AlexisCab1602_1-1631193053454.png

I leave you the information of my R script configuration

AlexisCab1602_2-1631193103940.png

1 ACCEPTED SOLUTION

I have already solved the problem, although not in the way I expected, I have simply loaded the columns to the visual object and in the code line 3 I have put "#dataset<-data.frame()", row 4 I have not touched. Then I write my R script and consider all the columns I've added to the visual, regardless of whether they're not mentioned within the dataset.

Someone told me that this can happen if Power BI is not updated to the latest version of R, I have the latest versions of both programs, so I hope this will be fixed in the next update. Thanks a lot.

View solution in original post

4 REPLIES 4
Greg_Deckler
Super User
Super User

@Syndicate_Admin Your images are too small, I can't tell what is going on even when I zoom.


@ me in replies or I'll lose your thread!!!
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Learn Power BI 2nd Edition

I can open them without problems and I see them with perfect quality (I will edit the size of the images of the post), but either way I make some cuts here. Basically this is what the R script editor looks like despite having 3 columns of a table loaded into the visual

AlexisCab1602_0-1631195907383.png

AlexisCab1602_1-1631195974902.png

the problem is that supposedly this visual object automatically loads me to the script the columns that I add, which happens in all the videos I have seen. And because of this I can't run graphs of interest. I leave the R script settings I currently have.

AlexisCab1602_2-1631196084356.png

You can add a column to your dataset that uniquely identifies each row, similar to an IDENTITY column in a SQL Server table.

Use R script in desktop. Please refer to https://www.red-gate.com/simple-talk/sql/bi/power-bi-introduction-working-with-r-scripts-in-power-bi...  for more details.

I have already solved the problem, although not in the way I expected, I have simply loaded the columns to the visual object and in the code line 3 I have put "#dataset<-data.frame()", row 4 I have not touched. Then I write my R script and consider all the columns I've added to the visual, regardless of whether they're not mentioned within the dataset.

Someone told me that this can happen if Power BI is not updated to the latest version of R, I have the latest versions of both programs, so I hope this will be fixed in the next update. Thanks a lot.

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Power BI Dev Camp Session 23 768x460.jpg

Check it Out!

Mark your calendars and join us on Thursday, June 30 at 11a PDT for a great session with Ted Pattison!

June 20 episode 7 with aka link 768x460.jpg

The Power BI Community Show

Join us on June 20 at 11 am PDT when Kim Manis shares the latest on Azure Synapse analytics, the Microsoft Intelligent Data Platform, and notable Power BI Updates from Microsoft Build 2022.

Top Solution Authors
Top Kudoed Authors