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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
Anonymous
Not applicable

Trying to transfer RStudio code to R script in Power BI

jostho99_0-1647366111133.png

 

Hi everyone, I have transfered this R code from Rstudio into power BI and everything runs fine with no errors but no visuals appear. When I run this same code in RStudio the visual appears exactly how I want it to. I am using the networkD3 and dplyr packages to create a sankey diagram.

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

 

I find a solved post with similar problem like yours.  You can follow the blog to create the R visual in Power BI. 

For reference:

Interactive Charts using R and Power BI: Create Custom Visual Part 1

 

Best Regards,
Rico Zhou

 

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

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

jostho99_0-1647371272622.png

 

This is the flag that is appearing when I run the code in Power BI but I am clearly calling sankeyNetwork to have the visual appear. Does this have to do with how I am calling the data values? I am pretty new to using power bi with R so I would not be surprised if I am doing a mistake like that.

Anonymous
Not applicable

Hi @Anonymous ,

 

I find a solved post with similar problem like yours.  You can follow the blog to create the R visual in Power BI. 

For reference:

Interactive Charts using R and Power BI: Create Custom Visual Part 1

 

Best Regards,
Rico Zhou

 

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

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

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.