Power BI and R : A winning combo!

Suraj Thatte
2 min readJan 13, 2019

--

One of the challenges faced in deployment of analytics is getting analytics into the hands of decision makers throughout the vertical cross section of the organization. Based on their background and roles, different individuals have varying needs for analytics (reporting vs. analytics) and comfort levels of interaction (self-service analytics vs. point solutions)

In this regard, Power BI and R complement each other very well. R is a great tool for advanced analytics — predictive modeling, Machine learning, complex visualizations. Power BI provides an interactive visualization experience and the ease to share reports/dashboards with your audience. Power BI offering for mobile Apps further enhances the accessibility aspect.

There are several ways in which R and Power BI can work together -

  • Case 1: Running R scripts in Power BI
  • Case 2: R visuals within Power BI
  • Case 3: Visualizing results of complex R scripts
Note: In the figure above, database as a source is only an example for illustration. Both R and Power BI can connect to a variety of source systems.
  • Case 1. Power BI can be connected to R scripts as a data source. One can then use packages like ‘dplyr’, ‘reshape’ for data cleansing and transformation before developing visuals in Power BI. Also, R scripts can be used as a ‘bridge’ between Power BI and sources that are not currently supported by Power BI connectors. An example would be connecting to Google Drive files.
  • Case 2. Power BI has a lot of powerful visuals built-in as well as sourced from marketplace. In addition, R visuals can be used to further customize and enhance these visuals. Packages like ‘ggplot2’ and ‘ggrepel’ can come in handy.
  • Case 3. In several instances, one might be using R to run complex computations. In this case, we may not be able to connect to R script as a source (Case 1) due to size and run-time limitations. In such cases, results of the computations can be written back to a database. We can then use Power BI for visualizing them. For organizations with higher analytics maturity and the necessary infrastructure, this case would be fulfilled by different elements in their analytics stack architecture.

All of the above functionalities can be achieved using various R packages and R Shiny for interactive Web applications. But from an ‘Impact/Effort’ standpoint, I have found Power BI to be a better alternative. In my upcoming articles, I will post examples of each of these cases with a detailed description of how to get there.

Meanwhile, I am eager to know what challenges you’ve faced while deploying analytics. How did you overcome these? Which tools did you use?

Feel free to comment below!

--

--

Suraj Thatte

Passionate about coding, exploring new analytics tools, visual design, statistics, math and coaching others; all views are my own