Exporting R to Microsoft Power BI
R is a great standalone tool used to deliver reports to users, but it is also one of the few languages that are incorporated into several other BI tools, such as Microsoft Power BI. When we last explored Power BI in Chapter 3, Analysis with Excel and Creating Interactive Maps and Charts with Power BI, we focused on visualizing data pulled in from a Microsoft SQL Server query. You may then ask why it would be necessary to pull in data through R when it can be done directly through Power BI. As we saw earlier when we were forecasting data, R has the ability to generate data points based on different libraries applied to the original dataset. This generated data can then be easily merged back into the original dataset. It is this merged dataset that brings added value to a visualization inside of Power BI.
Merging new columns to dataframes in R
The original dataframe used in this chapter was called SQL_Query_1
and contained Discount Codes
by Week
. We could choose...