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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
Anonymous
Not applicable

R Visual Error - The R process ended unexpectedly

I have a very simple R plot I am trying to add to my PowerBI Report.

 

Here is the code:

# The following code to create a dataframe and remove duplicated rows is always executed and acts as a preamble for your script:

# dataset <- data.frame(Value, Measure)
# dataset <- unique(dataset)

# Paste or type your script code here:
library(ggplot2)

ggplot(data = dataset, aes(x=Measure,y=Value)) + geom_bar(position="dodge", stat="identity")
 
When I open in RStudio, it runs fine with no issues. But when I run in Power BI Desktop, I receive the following error message:
 
Can't Display this visual. The R process ended unexpectedly, so the visual can't be displayed. Please try running it again.
 
Any ideas?
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

Actually, your code works well on my side. Which power bi version and r script version you test?

library(ggplot2)
options(scipen=999)
ggplot(data=dataset, mapping =aes(x=dataset$ID, y= dataset$Amount, group=1)) + geom_bar(position="dodge", stat="identity")

16.png

Regards,

Xiaoxin Sheng

View solution in original post

2 REPLIES 2
BrentonC
Helper I
Helper I

I had the same issue, I was using my work computer and the default location was "\\MAR-XXXX\homedrive$\Brenton.Collins\R"

It was a mapped drive that must have been causing the issue.

 

I installed it on C:\R instead which fixed the issue.

 

 

Anonymous
Not applicable

Hi @Anonymous ,

Actually, your code works well on my side. Which power bi version and r script version you test?

library(ggplot2)
options(scipen=999)
ggplot(data=dataset, mapping =aes(x=dataset$ID, y= dataset$Amount, group=1)) + geom_bar(position="dodge", stat="identity")

16.png

Regards,

Xiaoxin Sheng

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

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.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.