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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

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.



Follow on LinkedIn
@ 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!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Feb2025 NL Carousel

Fabric Community Update - February 2025

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