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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

R graphics libraries does not work in PBI?

Hi everybody,

 

 

I'm trying to bring my graphics from RStudio to PBI but it's giving me this error: "Can't display this visual. Make sure your R scripts results in a plot to the R default device"

 

I tried using dygraph and plotly , but they give me the same error. Does anyone know which R library I can use in PBI to make my graphics prettier and interactive, like this one: https://moderndata.plot.ly/interactive-r-visualizations-with-d3-ggplot2-rstudio/

 

 

Thank you!

1 ACCEPTED SOLUTION
CanadaMGB
Frequent Visitor

Not an R expert by any means, but the only way I'm aware of using Plotly in Power Bi is via the custom visual. I successfully followed the instructions from the radacad blog linked below a while back. Its a much more involved process than the regular R visual, but the results are there. It does require installation of node.js as well.

 

http://radacad.com/interactive-map-using-r-and-power-bi-create-custom-visual-part-1

View solution in original post

8 REPLIES 8
CanadaMGB
Frequent Visitor

Not an R expert by any means, but the only way I'm aware of using Plotly in Power Bi is via the custom visual. I successfully followed the instructions from the radacad blog linked below a while back. Its a much more involved process than the regular R visual, but the results are there. It does require installation of node.js as well.

 

http://radacad.com/interactive-map-using-r-and-power-bi-create-custom-visual-part-1

Anonymous
Not applicable

Hi @CanadaMGB,

 

thank you so much for this material, this seems a great 'workaround' for my problem. Guess I'm gonna have to create a custom visual whenever I want to plot interactive R graphs. 😄

 

Hopefully, PBID team will make the R chart option suport more R libraries in the future.

 

 

Best,

I.A.

I'm posting in this old thread for the benefit of people googling for this stuff (or in Microsoft's fantasy universe, "binging").

 

The Power BI documentation sounds a bit arcane if you're not versed in R. When they talk about the "R default display device", what they mean is that "regular" R charts will only work with R packages that generate an image (typically PNG). As you found out, it's only by creating a custom R chart that you can work with R packages that generate HTML, which is how the interactive ones work (e.g. Leaflet).

 

This can be confusing when the same code that works in Rstudio fails in Power BI. But PBI does give you a clue in its error message, telling you that "No image was created. The R code didn't result in creation of any visuals".

 

For reference, see known limitations here:

https://docs.microsoft.com/en-us/power-bi/desktop-r-visuals

------------------------------------------------
1. How to get your question answered quickly - good questions get good answers!
2. Learning how to fish > being spoon-fed without active thinking.
3. Please accept as a solution posts that resolve your questions.
------------------------------------------------
BI Blog: Datamarts | RLS/OLS | Dev Tools | Languages | Aggregations | XMLA/APIs | Field Parameters | Custom Visuals
Anonymous
Not applicable

Hi!

 

This thread is now somewhat old, but I think still valid.

I am trying to create a gauge with R based on flexdashboard. 

The goal for this is to have a gauge chart, to which the colour changes depending on the %.

 

This example workd in Rstudio

https://rdrr.io/cran/flexdashboard/man/gauge.html

 

But not in PowerBI 😞

Can it be that flexdashboard generates something dynamic, where PBI is expecting something fix? If yes, what would be the workaround?

 

Cheers. G.

@Anonymous only some R libraries are supported in Power BI:

https://docs.microsoft.com/en-us/power-bi/service-r-packages-support

------------------------------------------------
1. How to get your question answered quickly - good questions get good answers!
2. Learning how to fish > being spoon-fed without active thinking.
3. Please accept as a solution posts that resolve your questions.
------------------------------------------------
BI Blog: Datamarts | RLS/OLS | Dev Tools | Languages | Aggregations | XMLA/APIs | Field Parameters | Custom Visuals
Anonymous
Not applicable

Thanks @otravers for the hint!
I feel i will have fun...

 

v-caliao-msft
Microsoft Employee
Microsoft Employee

@Anonymous,

 

>>"Can't display this visual. Make sure your R script results in a plot to the R default device."

For this issue, please check if the information on the link below helps or not.
http://community.powerbi.com/t5/Issues/R-visuals-with-the-DiagrammeR-package-don-t-work-in-Power-BI/idi-p/174131

 

Regards,

Charlie Liao

Anonymous
Not applicable

That thread doesn't really answer my question. But thanks anyways.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.