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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
emaxon
Frequent Visitor

R Visual Error Object Not Found

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.

3 REPLIES 3
Anonymous
Not applicable

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.

Anonymous
Not applicable

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

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.