Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hi,
I need to build an interactive control chart in Ppower BI Desktop. I followed a step-to-step procedure as described in the community link The R code didn't result in creation of any visual... - Microsoft Fabric Community but getting an R script error as:
source('./r_files/flatten_HTML.r')
############### Library Declarations ###############
libraryRequireInstall("ggplot2");
libraryRequireInstall("plotly")
####################################################
################### Actual code ####################
g = qplot(`Petal.Length`, data = Values, fill = `Species`, main = Sys.time());
####################################################
############# Create and save widget ###############
p = ggplotly(g);
internalSaveWidget(p, 'out.html');
####################################################
################ Reduce paddings ###################
ReadFullFileReplaceString('out.html', 'out.html', ',"padding":[0-9]*,', ',"padding":0,')
####################################################
I spent loads of time on error resolution but didn't get through. Can someone in the community help me please?
Thanks In Advance;
Abhi
Solved! Go to Solution.
@AJ_2024 from the error, looks like you are missing some libraries, xml2, htmlwidgets. Do you want to try installing them and see if it works. If you have already installed them and it still does not work (which happened to me), the following worked for me.
When I run R in PBI, the packages are accessed by PBI from C:\Users\xxxx\Library. However, when I install the packages from R studio, the installed packages get saved in C:\Users\xxxx\Documents\R\win-library\3.5. Therefore, I changed the default path of "Install to Library:" in R studio from C:\Users\xxxx\Documents\R\win-library\3.5 to C:\Users\xxxx\Library and I got the desired output.
You cannot bring your own renderer. Only the standard plotting device is supported.
Create Power BI visuals using R - Power BI | Microsoft Learn
I am a pro user, I think we can create our own custom Power BI visuals that is packaged in single .pbiviz file and can be imported into the report.
@AJ_2024 from the error, looks like you are missing some libraries, xml2, htmlwidgets. Do you want to try installing them and see if it works. If you have already installed them and it still does not work (which happened to me), the following worked for me.
When I run R in PBI, the packages are accessed by PBI from C:\Users\xxxx\Library. However, when I install the packages from R studio, the installed packages get saved in C:\Users\xxxx\Documents\R\win-library\3.5. Therefore, I changed the default path of "Install to Library:" in R studio from C:\Users\xxxx\Documents\R\win-library\3.5 to C:\Users\xxxx\Library and I got the desired output.
This worked for me. Thanks
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.