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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
MattCrowley
New Member

PBI not adding first 3 lines to RStudio

When I create an R visual with local data queried from Salesforce & Redshift, and then click the "open in RStudio" button. PBI does not add the first 3 lines that load my data.

 

broken PBI to R


Given that the folders in under Appdata/local/radio/ use obscure ids, it's really hard to know which is the proper file to load if I wanted to do it manually.

 

Thoughts?

 

- Matt

2 REPLIES 2
v-sihou-msft
Microsoft Employee
Microsoft Employee

@MattCrowley

 

You need to Run the R file instead of working in console.

 

55.PNG

 

The chart will display properly in Rstudio.

 

68.PNG

 

Regards, 

Hi, thanks for the response!

 

What do you mean by "Run"? I have tried clicking the "Run script" button in the PBI script editor before and after clicking "Edit script in external R IDE".

 

Btw, this is using RStudio 3.3.3 

 

Steps from a blank page:

1. Add R visual to the page

Result: Script editor opens and is blank because there are no fields

2. Add my 2 fields c_email, u_email to the values field

Result: he script editor populates with the R script to create a dataframe, but the "Run Script" is still grayed out, since no script that actually does anything has been added yet

3. Click "Edit script in external R IDE"

Result: RStudio opens to a blank console window with no data loaded... help files suggest it should load the data set.

 

OK, so lets rewind a step and try running something first:

 

3. Add "plot(1)" to the R script editor in PBI

Result: the "Run Script" button is now active

4. Click "Run Script" button in PBI script editor

Result: a plot shows up in the R visual on the PBI page, as expected

5. Click "Edit script in external R IDE"

Result: RStudio opens to a blank console window with no data loaded.

 

Through all of this, I can see that when I click "Edit script in external R IDE", a folder is created in appdata/local/radio exactly as it should. And when I close the RStudio window the folder is removed. So that seems to be working fine. RStudio just isn't loading the R file in that folder.

 

I even tried setting the temp folder to a new location to make sure RStudio had access to it. Still doesn't work!

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors