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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

R script visual not working in service but works in desktop

Hi

 

I have an R-visual using ggplot2, dplyr, and gridextra (all supported packages) that works completely fine in Desktop, but gives me a script runtime error on the service. 

 

I have a dataset in Workspace1 (premium) that I connect to via my desktop report. Here I make the R-visual and publish to Workspace2 where it gives me the following runtime error:

Script Runtime Error

Attaching package: 'dplyr' The following object is masked from 'package:gridExtra': combine The following objects are masked from 'package:stats': filter, lag The following objects are masked from 'package:base': intersect, setdiff, setequal, union [1] "English_United States.1252" Error in Summary.factor(c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, : 'min' not meaningful for factors
Please try again later or contact support. If you contact support, please provide these details.

 

This is not something I receive on the Desktop version. It works completely fine here. Is there anything I'm missing?

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

 

I'd like to suggest you to take a look at below document about use r script in power bi service:

Creating R visuals in the Power BI service#r-scripts-security

 

R visuals are created from R scripts, which could potentially contain code with security or privacy risks.

These risks mainly exist in the authoring phase when the script author run the script on their own computer.

The Power BI service applies a sandbox technology to protect users and the service from security risks.

This sandbox approach imposes some restrictions on the R scripts running in the Power BI service, such as accessing the Internet, or accessing to other resources that are not required to create the R visual.

 

For security reasons, some of r script functions has been blocked on power bi service side.(e.g. access external datasource, write/access to specific folder path, import/export file...) 

BTW, r script code with functions you not defined clearly or too complex to calculate(execute over 60s) also not works on service side.(such as, functions with undefined option parameters, undefined clearly data type, complex looping calculation...)
Notice: you can also check following link to confirm your packages are available on power bi service side:

R packages in the Power BI service

 

Best Regards,

Jay

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Hi @Anonymous ,

 

I'd like to suggest you to take a look at below document about use r script in power bi service:

Creating R visuals in the Power BI service#r-scripts-security

 

R visuals are created from R scripts, which could potentially contain code with security or privacy risks.

These risks mainly exist in the authoring phase when the script author run the script on their own computer.

The Power BI service applies a sandbox technology to protect users and the service from security risks.

This sandbox approach imposes some restrictions on the R scripts running in the Power BI service, such as accessing the Internet, or accessing to other resources that are not required to create the R visual.

 

For security reasons, some of r script functions has been blocked on power bi service side.(e.g. access external datasource, write/access to specific folder path, import/export file...) 

BTW, r script code with functions you not defined clearly or too complex to calculate(execute over 60s) also not works on service side.(such as, functions with undefined option parameters, undefined clearly data type, complex looping calculation...)
Notice: you can also check following link to confirm your packages are available on power bi service side:

R packages in the Power BI service

 

Best Regards,

Jay

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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 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