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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

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
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors