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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
ranjan
New Member

Automate R script from PowerBI

Hi,

I have recently started using Power BI for visualization. Am working on a project where I have to do some processing on data in SQL server and then load that data to PowerBI for the dashboarding. Now, it will work like a tool which will be refreshed at certain frequency.
I am trying to replace the processing part of the process from SQL server to R, since its much faster and versatile in processing.

Data(in SQL server) => Stored Procs in SQL Server => PowerBI ----- current scenario
Data(in SQL server) => R script => PowerBI ----- expected scenario

For now I am doing that using Getdata option in Power BI and run the R script manually everytime I need to refresh it. R connects to SQL server, loads it in memory, does the processing and a table is generated which I can use for dashboarding in PBI.

Is there a way where I can write some kind of function or query which can pick the R script when I open the dashboard, run it and refresh the dashoard. Basically, automate the process. I am stuck for quite some time now.

Appreciate any help.

Regards,
Ranjan

1 ACCEPTED SOLUTION
TomMartens
Super User
Super User

Hey,

 

unfortunately it's currently not possible to automate some data processsing using R scripts. This is due to the deprecation of the standalone Personal Gateway and the fact the new gateway currently does not support the execution of R scripts for data processing.

 

This thread may provide some additional information

https://community.powerbi.com/t5/Integrations-with-Files-and/R-Integration-with-Power-BI-Scheduled-R...

 

If you are in the lucky position to be able to use SQL Server 2016 or SQL Server 2017 you can use the integration of R or even Python (SQL Server 2017) from within a stored procedure, maybe this link gets you started:

https://docs.microsoft.com/en-us/sql/advanced-analytics/tutorials/sql-server-r-tutorials

 

Hopefully this of some help

 

Regards

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

View solution in original post

2 REPLIES 2
TomMartens
Super User
Super User

Hey,

 

unfortunately it's currently not possible to automate some data processsing using R scripts. This is due to the deprecation of the standalone Personal Gateway and the fact the new gateway currently does not support the execution of R scripts for data processing.

 

This thread may provide some additional information

https://community.powerbi.com/t5/Integrations-with-Files-and/R-Integration-with-Power-BI-Scheduled-R...

 

If you are in the lucky position to be able to use SQL Server 2016 or SQL Server 2017 you can use the integration of R or even Python (SQL Server 2017) from within a stored procedure, maybe this link gets you started:

https://docs.microsoft.com/en-us/sql/advanced-analytics/tutorials/sql-server-r-tutorials

 

Hopefully this of some help

 

Regards

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

Thanks Tom,

 

I hope it works out soon enough. And yeah, as suggested, I have started working on getting SQL Server 2016/17 so that I can run R script from there itself.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 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.