Power BI and R – Part 2 (Remarks and errors)

This entry is part [part not set] of 3 in the series Power BI and R

In part 1 of this series, I gave you a couple of reasons to start using R for visualizations in Power BI.

In this part I’ll tell you about the things I discovered and the problems that I ran into in this preview version.

Please note that the remarks below count for the december 2015 version of Power BI Desktop.
R script visuals is still a preview, things might change in later versions.

Version numbers

First off, let’s talk versions of Power BI Desktop.
I ran into quite a big problem for part 3 of my blog and while trying to figure out the reason with Dustin Ryan (blog | twitter) we found out that I was running a different december 2015 version than him.

I downloaded my version right after the update was available. I’m guessing that the PowerBI team silently released a newer version afterwards with a minor update.
Can’t really blame them, but from an enterprise standpoint, we need a notification and changelog to avoid version differences.


The official documentation still lists the .181 version as the latest. So someone dropped the ball there…

R packages

While taking the R integration for a spin I noticed that

  • Running a package that you don’t have installed in R gives the following error message1. RunPackageWithoutInstallError
  • Trying to install a package straight from Power BI without the proper rights gives the following message
    2. InstallPackageError
  • Setting a path that is writable but not specifying a correct CRAN mirror gives you this message
    3. ErrorPowerBIAsAdministratorAfterPersonalLibrary
  • So to use non-standard packages (like corrplot or ggplot2 for example), you need to have these packages installed in your R library.
  • If given write-rights to the library directory, Power BI Desktop can install these packages as well.
    This is huge as it means that you don’t have to exit Power BI and go to R Studio. The user of your .pbix possibly wouldn’t even have to manually install the required package.

Running other R functionality

From the previous point, it seems that R is just running in the background and that most of the functionality can be used.

Testing some basic functionality like importing and transforming data in the R visual worked fine.
I haven’t tried any predictive modelling yet but I assume that will just work as well.

The ugly

This brings me to an error that I’m currently receiving on both my desktop and my laptop.
I’m not sure where the error comes from as I’ve already tried the following

  • Reinstall Power BI
    • Here the difference in version number got noticed
  • Reinstall R  / Deinstall R and reinstall Revolution R Open (RRO)
    • Done both, both without result
  • Have someone else try the Power BI workbook I’m using
    • Works normally
  • Have someone else create a Power BI file with an R visual that works
    • Failed with the same error

The error tends to switch around a bit but this is the main one:
PowerBI_RStats_ErrorDo you know the solution for this error?

The awesome Tom Martens (blog | twitter) politely pointed out that I should RTFM a bit better as this error is caused by comma’s representing decimals. This explains why Dustin Ryan (US-based) was able to run my creation while I wasn’t.
RVisualErrorSolutionInstead of changing my entire region which has a larger effect aside from the decimal delimiter, I opened my control panel and just changed the Decimal symbol to a period. Doing this has the least impact on your system.

Have you tried anything cool that should be mentioned or linked here?
Leave a comment or get in touch via twitter or LinkedIn!

Series Navigation

8 thoughts on “Power BI and R – Part 2 (Remarks and errors)”

  1. Hi Jan,
    thanks for this very good overview. I’m new to R as well and have not yet decided how to tackle the learning. But results like the visualizations in this blog for example leave no place for doubts whether it’s worth using R: https://minceddata.wordpress.com/2015/12/27/data-visualization-using-ggplot2-to-create-custom-visuals-in-power-bi/

    I might take this code example and see if I can find the variables needed to adjust this chart to a different dataset. Maybe it will be enough to know how to adjust existing codes instead of being able to create them from scratch. Pretty sure that the Power BI community will come up with more fantastic examples to share 🙂

    I’ve used R for another non-visual task as well: Export data (your underlying data or every other dataset) from Power BI to txt (with the right settings, it can easily and clean be imported into Excel). As this was a feature often requested, it might interest your readers as well: http://www.thebiccountant.com/2015/12/28/how-to-export-data-from-power-bi-and-power-query/

    Great blog – keep it coming!
    BR, Imke

  2. Hello Jan –

    About the error you’ve been hitting: this is a known issue that we’re working on a fix for. Please try the following workaround for now:
    Modify your region settings format to English (World).
    This can be done via the control panel –> Region –> Formats.
    This problem might come up in region definitions where “,” is used as a decimal point…
    Again – we are actively working on fixing this.
    This issue surface here http://blogs.msdn.com/b/powerbi/archive/2015/12/17/announcing-preview-of-r-visuals-in-power-bi-desktop.aspx

    Please let us know if this works for you for now,

    Avi Sander, PBI.

    • Thanks for the comment Avi, really appreciate it!
      I was already referred to that workaround this morning and the post was updated to reflect the solution, including a link to the official blog.


Leave a Reply

%d bloggers like this: