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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
Anonymous
Not applicable

Setting up scheduled refresh for R script as data source

Hi all,

 

I have created R-Script as a data source (Note: I am not using the "Run as R-Script" feature but the R- Script as a data source itself) in my Power BI desktop file. 

I then published the PBIX file to the Power BI online version (app.powerbi.com). I now want to setup an automatic scheduled refresh for my dashboard. I have installed the Power BI personal gateway as suggested by the article but was not able to setup the scheduling part. Is there any documentation for the same?

 

Thanks,

HV

3 REPLIES 3
v-gizhi-msft
Community Support
Community Support

hi,

 

According to your description, I create a test pbix file and get data from R script.

15.PNG

Then create a visual, publish to Power BI Service.

Then start the personal gateway.

On the Power BI Service setting->dataset pane, it shows:

10.PNG

I start to configure scheduled refresh and it succeeds:

17.PNG

I try to refresh manually and it succeeds:

16.PNG

Above is my test workflow, for your problem, please check follows:

  • Update personal gateway to the latest version
  • Ensure the personal gateway is running on the same machine as R script directory
  • Specify credential for r data source
  • If the data source contains other kinds of sources, you need to specify credential for these data sources as well.

 

There is a solved case to refer to:

https://community.powerbi.com/t5/Power-Query/Refresh-R-Scripts-with-Personal-Gateway/td-p/434177/pag...

 

If you still have questions about it, please for free to let me know.

 

Best Regards,

Giotto Zhi

Anonymous
Not applicable

Capture.PNG

 

Hi @v-gizhi-msft ,

 

Here is the error that I am receiving. I have checked that my gateway and R script are on the same computer. My gateway is udpated. I referred to the post you shared and even switched off the connectors and restarted the gateway.

 

Originally, I was trying to pull data from SQL server using that R script, then manipulating data to create visuals. I even thought may be because of sql server, but I even tested for a simple R script (dataset = iris), I still get the same error. Please recommend.

 

Thanks,

HV

hi,

 

Please pay attention to this link:

https://community.powerbi.com/t5/Issues/Scheduled-refresh-with-R-not-working/idi-p/877818

 

 

Best Regards,

Giotto Zhi

Helpful resources

Announcements
December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.