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
HamidBee
Power Participant
Power Participant

Why is my R Plotly visual not displaying in Power BI?

On my personal device I have R and RStudio installed. I then opened Power BI Desktop and enabled R scripting (so that I could embed an R visual into the report). Power BI automatically detected that I have R installed.

 
 

R.png

 

I then typed the following R code into my R visual in Power BI:

 

library(plotly)

Animals <- c("giraffes", "orangutans", "monkeys")
SF_Zoo <- c(20, 14, 23)
LA_Zoo <- c(12, 18, 29)
data <- data.frame(Animals, SF_Zoo, LA_Zoo)

fig <- plot_ly(data, x = ~Animals, y = ~SF_Zoo, type = 'bar', name = 'SF Zoo')
fig <- fig %>% add_trace(y = ~LA_Zoo, name = 'LA Zoo')
fig <- fig %>% layout(yaxis = list(title = 'Count'), barmode = 'group')

fig

But it keeps saying 'Can't display this visual':

 

R visual.png

 

2 REPLIES 2
stevedep
Memorable Member
Memorable Member

You can take a look at this blog post. It describes how to add an interactive javascript Plotly Chart in Power BI. It's quite easy. 

 

Kind regards,

 

Steve.

johncolley
Solution Sage
Solution Sage

Hi @HamidBee , Can you share the details within the error message?

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.