Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hi,
I have the following dataset.
Solved! Go to Solution.
Hi @bobbob123 ,
Sorry to reply so late. Plotly lib is supported as part of HTML support for R powered Custom Visuals only, not R Visuals in general currently.
Plotly can only be used if it produces an IMAGE\PNG for R visuals in PBI. Not HTML.
If you want to create interactive visualizations using plotly. The only way you can do is to create a custom Power BI visualization and import it to your report. See these posts for a good introduction.
Interactive Charts using R and Power BI: Create Custom Visual Part 1
Interactive Charts using R and Power BI: Create Custom Visual Part 2
How to create R custom visual (html) in PowerBI
And this is my test.
If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @bobbob123 ,
The most current version of R supported on both Power BI Desktop and the Power BI service is version 3.4.4.
And please try the code:
library(plotly)
plot_ly(data = dataset, x = ~SA, y = ~HM, type = "scatter", mode = "markers", color =~S)
If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
This is what I get.
Error Message:
R script error.
Loading required package: ggplot2
Attaching package: 'plotly'
The following object is masked from 'package:ggplot2':
last_plot
The following object is masked from 'package:stats':
filter
The following object is masked from 'package:graphics':
layout
Warning message:
replacing previous import 'vctrs::data_frame' by 'tibble::data_frame' when loading 'dplyr'
Error: unexpected symbol in "plot_ly(data = dataset, x = ~SA"
Execution halted
Hi @bobbob123 ,
Sorry to reply so late. Plotly lib is supported as part of HTML support for R powered Custom Visuals only, not R Visuals in general currently.
Plotly can only be used if it produces an IMAGE\PNG for R visuals in PBI. Not HTML.
If you want to create interactive visualizations using plotly. The only way you can do is to create a custom Power BI visualization and import it to your report. See these posts for a good introduction.
Interactive Charts using R and Power BI: Create Custom Visual Part 1
Interactive Charts using R and Power BI: Create Custom Visual Part 2
How to create R custom visual (html) in PowerBI
And this is my test.
If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
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.
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!