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

Try your skills in the Power BI Dataviz World Championship! Round one ends June 26. Join now

Reply
bobbob123
Helper III
Helper III

Plotly using R in POWER BI

Hi all,

 

First time using R and for someone reason its seems to be a hit and miss.

 

My code is below.

# dataset <- data.frame(H, SA, MA, Year, Subject)
# dataset <- unique(dataset)

library(plotly)

fig <- plot_ly(data = dataset, x = ~SA, y = ~MA)

fig
 
 
All I want to do is plotly to display a scatter plot using x=SA and y=MA.
 
For some reason its not working. It works perfectly fine in R Studio.
 
 
 
6 REPLIES 6
v-chenwuz-msft
Community Support
Community Support

Hi @bobbob123 ,

 

Please check this limitation list if there are some limitations in your operating environment.

Learn which R packages are supported - Power BI | Microsoft Docs

 

Best Regards

Community Support Team _ chenwu zhu

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

VijayP
Community Champion
Community Champion

@bobbob123 

Check the details on the error statement. you should be able to know the problem statement




Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
MY Blog || My YouTube Channel || Connect with me on Linkedin || My Latest Data Story - Ageing Analysis

Proud to be a Super User!


This is the message I recieve.

 

No image was created. The R code didnt result  in creation of any visuals.

 

As I've said It works on R Studio and I can run other simple scripts on Power BI using R. But I can't seem to get plotly to work.

VijayP
Community Champion
Community Champion

@bobbob123 

https://community.powerbi.com/t5/Desktop/Using-Plot-ly-with-R-in-Power-BI-Desktop/m-p/717803

This thread may help you!




Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
MY Blog || My YouTube Channel || Connect with me on Linkedin || My Latest Data Story - Ageing Analysis

Proud to be a Super User!


I'm not sure, I've tried to run other scripts on POWER BI it works. When I try plotly it doesn't.

Plotly requires use of Node.js to operate. PBI cannot render Plotly natively, so it needs to be 'wrapped' in Node.js to work. 

 

See link below

https://stackoverflow.com/questions/39368729/is-it-possible-to-use-r-plotly-library-in-r-script-visu...

Helpful resources

Announcements
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

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.