Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
I continue to get this error while trying to create an R visual.
Error in eval(m$data, parent.frame()) : object 'Email_Activity' not found
Calls: aggregate -> aggregate.formula -> eval -> eval
Execution halted
Here is the top of my code:
library(data.table)
library(stringr)
library(tidyverse)
library(scales)
library(ggthemes)
Mess_Tot = aggregate(cbind(Sent,Opened,Clicked) ~ Message.Title , data = Email_Activity , sum)
I am very experienced in R. My code works fine in R. My dataset in Power BI is named Email_Activity. What am I doing wrong here?
All help is greatly appreciated.
HI @emaxon ,
Power bi service has limitations on executing r scripts, you can refer to the official document to know more about these:
Creating R visuals in the Power BI service#r-scripts-security
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.
As the document said, invoke external datasoruce or access/edit to specify folder functions will be ignored due to security reasons.
BTW, some functions who not defined accurately will also be blocked on service side. If this is a case, I'd like to suggest you check your code to modify undefined function parameters.
Regards,
Xiaoxin Sheng
Hello Xiaoxin,
I am confused. When you say "invoke external datasoruce or access/edit to specify folder functions will be ignored due to security reasons". What do you mean?
Also when you said "some functions who not defined accurately will also be blocked". I have one line of code . Is my aggregate function not set up properly? It works fine in R.
Please elaborate. Thank you.
Hi @emaxon ,
#1, R visual support the data provided by power bi data model tables, if your dataset are from external datasoruce(e.g. you import data from special folder excel file), they will be blocked when these functions executed on power bi service sandbox.
#2, I mean functions who contains implicit conversion or default value of function parameters. When these script executed on power bi service side, they may not recognize because of defined 'not accurately'.
Reference link: R script visual not working in Service
Regards,
Xiaoxin Sheng
Check out the July 2025 Power BI update to learn about new features.
User | Count |
---|---|
24 | |
18 | |
18 | |
15 | |
13 |
User | Count |
---|---|
37 | |
22 | |
21 | |
18 | |
12 |