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!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi!
I am trying out a simple example building a Power BI Custom visual. I followed this tutorial https://medium.com/@Konstantinos_Ioannou/how-to-create-an-r-custom-visual-html-for-powerbi-7f2d2e44e... and every thing seems normal. But when I added my new visual inside Power BI and dragged in two fields from Fields list I got an error that won't go away. I really don't know how to fix this. I have tried many ways from reinstalling all the tools
Below you see the error inside Power BI desktop after I have dragged the custom visual into the report area and added the two fields. The script works in R Studio, but my report is failing in Power bi
Here is my rscript inside the visual studio code project:
Solved! Go to Solution.
I am not finished with finding the source of my problems.
It works in R studio and I have checked that both power bi and R studio run the same version of R. But I found a very interesting link on the web that may be shows the problem. I am checking that out now
https://community.powerbi.com/t5/Desktop/R-Visual-Rcpp-package-error/m-p/488849#M227795
Some below in that page it says:
I had yesterday the same problem. Only reinstalling (or even go back to older versions) did not help.
Only after I deleted the libraries in "<user>/documents/R" and in "<user>/library" and reinstalled R and installed the packages I needed, the problem was solved.
I think mixed package versions in <user>/library did give the problem for me. I did not know that packages were also in that directory. Only uninstall R en delete "<user>/documents/R" was not enough.
The newest version of PowerBi and R (3.5.1) are now working for me.
HI @Anonymous,
According to the error message, it seems like you miss some of R packages so these script formulas not able executed on power bi desktop side. (The package 'XXX' was not installed) You can copy your code to R studio to execute to check and install all required R packages.
In addition, it looks like you are working with creating a custom visual, I'd like to suggest you post this to develop subforum to get further support.
Regards,
Xiaoxin Sheng
I am not finished with finding the source of my problems.
It works in R studio and I have checked that both power bi and R studio run the same version of R. But I found a very interesting link on the web that may be shows the problem. I am checking that out now
https://community.powerbi.com/t5/Desktop/R-Visual-Rcpp-package-error/m-p/488849#M227795
Some below in that page it says:
I had yesterday the same problem. Only reinstalling (or even go back to older versions) did not help.
Only after I deleted the libraries in "<user>/documents/R" and in "<user>/library" and reinstalled R and installed the packages I needed, the problem was solved.
I think mixed package versions in <user>/library did give the problem for me. I did not know that packages were also in that directory. Only uninstall R en delete "<user>/documents/R" was not enough.
The newest version of PowerBi and R (3.5.1) are now working for me.
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 39 | |
| 36 | |
| 33 | |
| 31 | |
| 28 |
| User | Count |
|---|---|
| 128 | |
| 88 | |
| 79 | |
| 68 | |
| 63 |