SlideShare a Scribd company logo
Analytics with Power BI & R
- Hands on Session
Naresh Jasotani
Email: njasotani@miraclesoft.com
Director - Data & Analytics Services
Miracle Software Systems Inc.
October 2017
2 | P a g e
Table of Contents
1. Introduction .........................................................................................................................................3
2. Prerequisite..........................................................................................................................................3
3. Hands On #1.........................................................................................................................................3
3.1. Download the data .....................................................................................................................3
3.2. Open Power BI............................................................................................................................3
3.3. Import the data in Power BI.........................................................................................................3
3.4. Visualize the data........................................................................................................................5
3.5. Understand the data and trends ..................................................................................................7
4. Hands On #2.........................................................................................................................................7
4.1. Creating a R visual.......................................................................................................................7
4.2. Creating a Boxplot using R visual................................................................................................10
4.3. Create a ggplot using R visual.....................................................................................................11
5. Hands on #3 .......................................................................................................................................12
5.1. Time series forecasting using ARIMA alogrithm ...........................................................................12
5.2. Time series forecasting using custom visual ................................................................................13
5.3. Creating a predicted data table from R – ARIMA algorithm ..........................................................14
3 | P a g e
1. Introduction
Analytics with Power BI and R - A Hands on session
Organizations are looking to transform their data processing efforts into analytics and reports,
which gives them real-time insights into their business using machine learning and R recently.
Microsoft power BI as a self-service BI tool, which defines an approach for enabling self-service
analytics helps people to easily extract data from different sources, apply data transformation
for visualizing data in an appropriate way. R become a language for data analysis and machine
learning.
Recently, Microsoft enabled users to use R codes and visuals inside the Power BI. These hands
on exercises are designed to get you started with R codes, and visuals in Power BI.
2. Prerequisite
 Please bring your own laptops, with at least 4 GB of RAM. Laptop should be enabled to connect
to Wi-Fi or internet using mobile hot-spot.
 Please download and install the Power BI Desktop software from the location below:
https://powerbi.microsoft.com/en-us/desktop/
3. Hands On #1
3.1. Download the data
 Download the csv data from the following location, save it on your C: drive.
https://drive.google.com/open?id=0B-RQ0-9g-k1lWVdrVzBYN3BQQms
 Create a folder C:R
 The csv file should be available at this location – C:RRetail_Sales_Data.csv
3.2. Open Power BI
From the Desktop (or from the start menu) click on the following icon to launch the Power
BI Desktop
3.3. Import the data in Power BI
 Close the Sign-in window page if prompted, after opening the Power BI.
 Click on Get Data option on the under the Home Menu, and then select More.
4 | P a g e
 Click on Text/CSV, Click on Connect. Navigate to C:RRetail_Sales_Data.csv.
5 | P a g e
 Click on Load
3.4. Visualize the data
 On the right hand side Fields Menu, you would see a list of columns, as shown in the
screenshot below.
 Click on the checkbox next to SalesDate, Sales_Amt columns.
 Click on the small arrow next to SalesDate in the Visualizations section. Select the
SalesDate instead of Date Hierarchy.
 Click on the Line Chart from the Visualizations section (1st
icon on the 2nd
Row)
 Click anywhere on the page (white space outside the line chart, so that the line chart
is not selected).
 Select the checkbox next to ItemName under the Fields section.
6 | P a g e
 You would see a list of Item Names appearing on Page. Move the ItemName section on
the right side.
 Adjust the Line Chart to look something like this. Select the ItemName list section on the
right, and then select the Slicer (Filter Icon on the last row, 1st
Icon) from the
Visualization Section.
 Change the text size of the ItemName Slicer to 12 from the the Visualization Section
Navigation shown below.
7 | P a g e
3.5. Understand the data and trends
 Select Think Pad 450s from the Slicer, and see the trend against time.
 Select the Line Chart, and then select the Sales_Cost from the Fields.
 From the top ribbon, under Home Menu, select Text Box, and add the heading - Daily
Sales Trend.
4. Hands On #2
4.1. Creating a R visual
 Create a new page by clicking on the + icon for the new page, at the bottom left side of
the window. A new Page-2 is created.
 Add a Slicer for ItemNames similar to the slicer in Page-1 (steps included in the above
Hands on #1 section)
 In the Visualization section, in the last row of the available charts, find the R script
visual.
 Click on the R script visual, then click on the Enable button, as shown below.
Please note that if you don’t have R installed on your system, then download and install
R from the following location:
https://mran.revolutionanalytics.com/open/
8 | P a g e
 The R visual will look something like this. Select Sales_Amt, Sales_Cost and Sales_Qty
from the Fields section.
9 | P a g e
 In the R script section of the visual, copy-paste the following code, and then click
Run Script. Please note that you have to install.packges(‘ggplot2’), if you haven’t
used ggplot2 package before.
library(ggplot2)
t<-plot(dataset)
 Select Think Pad 450s from the slicer option. The plot would look like this:
Congratulations!! You have successfully ran R script from Power BI.
10 | P a g e
4.2. Creating a Boxplot using R visual
 Select another R visual on the same page, and then select ItemName, Sales_Qty and
Discount.
 Then write the following piece of code, in the R script area; then click on Run Script.
boxplot(dataset$Sales_Qty, main="Boxplot", ylab="Sales_Qty")
 Select Think Pad 450s from the slicer option. The plot would look like this:
 To find a correlation between Sales_Qty and Discount, use # symbol to comment out
the first line of code, then add the following piece of code, in the R script area; click on
Run Script. Observe that the correlation between Discount and Sales_Qty
#boxplot(dataset$Sales_Qty, main="Boxplot", ylab="Sales_Qty")
boxplot(Discount~Sales_Qty,data=dataset, main="Boxplot", ylab="Sales_Qty")
11 | P a g e
4.3. Create a ggplot using R visual
 Install the ggplot2 package using the R console.
install.packages(‘ggplot2’)
 Go back to Power BI, then create a new page by clicking on the + icon for the new page,
at the bottom left side of the window. A new Page-3 is created.
 In the Visualization section, in the last row of the available charts, find the R script
visual.
 Click on the R script visual, then click on the Enable button, as shown below.
 Select another R visual on the same page, and then select ItemName, Sales_Qty and
Discount.
 Then write the following piece of code, in the R script area; then click on Run Script.
library(ggplot2)
ggplot(dataset, aes(x = ItemName , y = Sales_Qty,fill = ItemName )) + geom_bar(width
= 0.85, stat="identity")
12 | P a g e
5. Hands on #3
5.1. Time series forecasting using ARIMA alogrithm
 Create a new page by clicking on the + icon for the new page, at the bottom left side of
the window. A new Page-4 is created.
 Add a Slicer for ItemNames similar to the slicer in Page-1 (steps included in the above
Hands on #1 section)
 In the Visualization section, in the last row of the available charts, find the R script
visual.
 Click on the R script visual, then click on the Enable button, as shown below.
 Select another R visual on the same page, and then select SalesDate, Sales_Amt.
 Then write the following piece of code, in the R script area; then click on Run Script.
Please install forecast and tseries R-packages if not already installed.
library(forecast)
library(tseries)
ARIMA_Sales<-ts(dataset$Sales_Amt,start=c(1))
Sales_Forecast<-auto.arima(ARIMA_Sales, seasonal=TRUE)
Predicted_Sales<- forecast(Sales_Forecast, h=10)
plot(Predicted_Sales)
13 | P a g e
5.2. Time series forecasting using custom visual
 Create a new page by clicking on the + icon for the new page, at the bottom left side of
the window. A new Page-5 is created.
 Add a Slicer for ItemNames similar to the slicer in Page-1 (steps included in the above
Hands on #1 section)
 From the Visualization section, click on the (…), and then select Import from store
option. Please note that you need a Power BI account. You can sign-up for a free account
using your corporate email id on powerbi.com
 From the Advanced Analytics section, click on Add button against Forecasting with
ARIMA.
 You will see an additional visual appearing in the Visualizations section.
 Click on the Forecasting with ARIMA visual, and then drag and drop the SalesDate in the
Date section of the visual, and the Sales_Amt in the values section.
Please be patient, it may take a few minutes to load.
14 | P a g e
5.3. Creating a predicted data table from R – ARIMA algorithm
 Click on Edit Queries from the Home menu on the top of the window. A new window
opens up like this.
 In the Query Editor, click on the New Source -> More from the top of the window, and
then click on the R Script.
 Enter the following code in the R editor window. Please install forecast and tseries R-
packages if not already installed.
dataset <- read.csv('C:RRetail_Sales_Data.csv', header=TRUE,
stringsAsFactors=FALSE)
library(forecast)
library(tseries)
ARIMA_Sales<-ts(dataset$Sales_Amt,start=c(1))
Sales_Forecast<-auto.arima(ARIMA_Sales, seasonal=TRUE)
Predicted_Sales<- forecast(Sales_Forecast, h=10)
plot(Predicted_Sales)
Predicted_Sales_Table <- data.frame(Predicted_Sales)
15 | P a g e
 In the Navigator window, you would see an option to select the data or the output
Predicted_Sales_Table. Select the second one.
16 | P a g e
 You would see the predicted output table is added to the data model.
Congratulations!! You have successfully learnt various methods of executing R
scripts from Power BI.

More Related Content

Similar to Analytics with Power BI and R (20)

PDF
Where can buy Data Analysis with Microsoft Power Bi Brian Larson ebook with c...
kunicsfouyem
 
PDF
Data Analysis with Microsoft Power Bi - eBook PDF
ereraplamp54
 
PDF
Data Analysis with Microsoft Power Bi - eBook PDF
suterhussyd7
 
PDF
Data Analysis with Microsoft Power Bi - eBook PDF
eoblubdi6093
 
PDF
Data Analysis with Microsoft Power Bi - eBook PDF
hokszcaloin
 
PPTX
Power BI(Empower Your Data: Unleash Business Insights with Our Comprehensive ...
jahanvi52
 
PDF
Data Analysis with Microsoft Power Bi Brian Larson
didascapinsk
 
PDF
Untitled
Kaizenlogcom
 
PDF
Data Analysis with Microsoft Power Bi - eBook PDF
laddsubych57
 
PDF
Download Data Analysis with Microsoft Power Bi - eBook PDF ebook All Chapters...
sygsiiotchie
 
PDF
Instant Download Data Analysis with Microsoft Power Bi - eBook PDF PDF All Ch...
jiliensinesh
 
PDF
Master the Art of Data Visualizations with Credo Systemz (1).pdf
csvishnukumar
 
PDF
Master the Art of Data Visualizations with Credo Systemz (1).pdf
nishajeni1
 
PDF
Master the Art of Data Visualizations with Credo Systemz (1).pdf
nishajeni1
 
PPTX
R in Power BI
Eric Bragas
 
PPTX
Power BI as a storyteller
Berkovich Consulting
 
PDF
Power bi slide share pdf it is a very important
Satyabratarath5
 
PPTX
Powerbi presentation from Microsoft Corporation
EngineerMBA1
 
PDF
General Presentation - DIAD and AIAD, Dashboard and Apps
Vishal Pawar
 
PPTX
How Power Bi can solve your most data analytics requirements
ssuserb69671
 
Where can buy Data Analysis with Microsoft Power Bi Brian Larson ebook with c...
kunicsfouyem
 
Data Analysis with Microsoft Power Bi - eBook PDF
ereraplamp54
 
Data Analysis with Microsoft Power Bi - eBook PDF
suterhussyd7
 
Data Analysis with Microsoft Power Bi - eBook PDF
eoblubdi6093
 
Data Analysis with Microsoft Power Bi - eBook PDF
hokszcaloin
 
Power BI(Empower Your Data: Unleash Business Insights with Our Comprehensive ...
jahanvi52
 
Data Analysis with Microsoft Power Bi Brian Larson
didascapinsk
 
Untitled
Kaizenlogcom
 
Data Analysis with Microsoft Power Bi - eBook PDF
laddsubych57
 
Download Data Analysis with Microsoft Power Bi - eBook PDF ebook All Chapters...
sygsiiotchie
 
Instant Download Data Analysis with Microsoft Power Bi - eBook PDF PDF All Ch...
jiliensinesh
 
Master the Art of Data Visualizations with Credo Systemz (1).pdf
csvishnukumar
 
Master the Art of Data Visualizations with Credo Systemz (1).pdf
nishajeni1
 
Master the Art of Data Visualizations with Credo Systemz (1).pdf
nishajeni1
 
R in Power BI
Eric Bragas
 
Power BI as a storyteller
Berkovich Consulting
 
Power bi slide share pdf it is a very important
Satyabratarath5
 
Powerbi presentation from Microsoft Corporation
EngineerMBA1
 
General Presentation - DIAD and AIAD, Dashboard and Apps
Vishal Pawar
 
How Power Bi can solve your most data analytics requirements
ssuserb69671
 

Recently uploaded (20)

PDF
NSEST - 2025-Brochure srm institute of science and technology
MaiyalaganT
 
PDF
Data science AI/Ml basics to learn .pdf
deokhushi04
 
PPTX
Monitoring Improvement ( Pomalaa Branch).pptx
fajarkunee
 
PPSX
PPT1_CB_VII_CS_Ch3_FunctionsandChartsinCalc.ppsx
animaroy81
 
PDF
Microsoft Power BI - Advanced Certificate for Business Intelligence using Pow...
Prasenjit Debnath
 
PDF
TESDA License NC II PC Operations TESDA, Office Productivity
MELJUN CORTES
 
PPTX
MENU-DRIVEN PROGRAM ON ARUNACHAL PRADESH.pptx
manvi200807
 
PDF
CT-2-Ancient ancient accept-Criticism.pdf
DepartmentofEnglishC1
 
PPTX
english9quizw1-240228142338-e9bcf6fd.pptx
rossanthonytan130
 
PPT
Reliability Monitoring of Aircrfat commerce
Rizk2
 
PPTX
Data anlytics Hospitals Research India.pptx
SayantanChakravorty2
 
PPTX
727325165-Unit-1-Data-Analytics-PPT-1.pptx
revathi148366
 
PDF
Predicting Titanic Survival Presentation
praxyfarhana
 
PPTX
Module-2_3-1eentzyssssssssssssssssssssss.pptx
ShahidHussain66691
 
DOCX
COT Feb 19, 2025 DLLgvbbnnjjjjjj_Digestive System and its Functions_PISA_CBA....
kayemorales1105
 
PDF
Orchestrating Data Workloads With Airflow.pdf
ssuserae5511
 
PDF
5991-5857_Agilent_MS_Theory_EN (1).pdf. pdf
NohaSalah45
 
PDF
IT GOVERNANCE 4-2 - Information System Security (1).pdf
mdirfanuddin1322
 
PPTX
Daily, Weekly, Monthly Report MTC March 2025.pptx
PanjiDewaPamungkas1
 
NSEST - 2025-Brochure srm institute of science and technology
MaiyalaganT
 
Data science AI/Ml basics to learn .pdf
deokhushi04
 
Monitoring Improvement ( Pomalaa Branch).pptx
fajarkunee
 
PPT1_CB_VII_CS_Ch3_FunctionsandChartsinCalc.ppsx
animaroy81
 
Microsoft Power BI - Advanced Certificate for Business Intelligence using Pow...
Prasenjit Debnath
 
TESDA License NC II PC Operations TESDA, Office Productivity
MELJUN CORTES
 
MENU-DRIVEN PROGRAM ON ARUNACHAL PRADESH.pptx
manvi200807
 
CT-2-Ancient ancient accept-Criticism.pdf
DepartmentofEnglishC1
 
english9quizw1-240228142338-e9bcf6fd.pptx
rossanthonytan130
 
Reliability Monitoring of Aircrfat commerce
Rizk2
 
Data anlytics Hospitals Research India.pptx
SayantanChakravorty2
 
727325165-Unit-1-Data-Analytics-PPT-1.pptx
revathi148366
 
Predicting Titanic Survival Presentation
praxyfarhana
 
Module-2_3-1eentzyssssssssssssssssssssss.pptx
ShahidHussain66691
 
COT Feb 19, 2025 DLLgvbbnnjjjjjj_Digestive System and its Functions_PISA_CBA....
kayemorales1105
 
Orchestrating Data Workloads With Airflow.pdf
ssuserae5511
 
5991-5857_Agilent_MS_Theory_EN (1).pdf. pdf
NohaSalah45
 
IT GOVERNANCE 4-2 - Information System Security (1).pdf
mdirfanuddin1322
 
Daily, Weekly, Monthly Report MTC March 2025.pptx
PanjiDewaPamungkas1
 
Ad

Analytics with Power BI and R

  • 1. Analytics with Power BI & R - Hands on Session Naresh Jasotani Email: [email protected] Director - Data & Analytics Services Miracle Software Systems Inc. October 2017
  • 2. 2 | P a g e Table of Contents 1. Introduction .........................................................................................................................................3 2. Prerequisite..........................................................................................................................................3 3. Hands On #1.........................................................................................................................................3 3.1. Download the data .....................................................................................................................3 3.2. Open Power BI............................................................................................................................3 3.3. Import the data in Power BI.........................................................................................................3 3.4. Visualize the data........................................................................................................................5 3.5. Understand the data and trends ..................................................................................................7 4. Hands On #2.........................................................................................................................................7 4.1. Creating a R visual.......................................................................................................................7 4.2. Creating a Boxplot using R visual................................................................................................10 4.3. Create a ggplot using R visual.....................................................................................................11 5. Hands on #3 .......................................................................................................................................12 5.1. Time series forecasting using ARIMA alogrithm ...........................................................................12 5.2. Time series forecasting using custom visual ................................................................................13 5.3. Creating a predicted data table from R – ARIMA algorithm ..........................................................14
  • 3. 3 | P a g e 1. Introduction Analytics with Power BI and R - A Hands on session Organizations are looking to transform their data processing efforts into analytics and reports, which gives them real-time insights into their business using machine learning and R recently. Microsoft power BI as a self-service BI tool, which defines an approach for enabling self-service analytics helps people to easily extract data from different sources, apply data transformation for visualizing data in an appropriate way. R become a language for data analysis and machine learning. Recently, Microsoft enabled users to use R codes and visuals inside the Power BI. These hands on exercises are designed to get you started with R codes, and visuals in Power BI. 2. Prerequisite  Please bring your own laptops, with at least 4 GB of RAM. Laptop should be enabled to connect to Wi-Fi or internet using mobile hot-spot.  Please download and install the Power BI Desktop software from the location below: https://powerbi.microsoft.com/en-us/desktop/ 3. Hands On #1 3.1. Download the data  Download the csv data from the following location, save it on your C: drive. https://drive.google.com/open?id=0B-RQ0-9g-k1lWVdrVzBYN3BQQms  Create a folder C:R  The csv file should be available at this location – C:RRetail_Sales_Data.csv 3.2. Open Power BI From the Desktop (or from the start menu) click on the following icon to launch the Power BI Desktop 3.3. Import the data in Power BI  Close the Sign-in window page if prompted, after opening the Power BI.  Click on Get Data option on the under the Home Menu, and then select More.
  • 4. 4 | P a g e  Click on Text/CSV, Click on Connect. Navigate to C:RRetail_Sales_Data.csv.
  • 5. 5 | P a g e  Click on Load 3.4. Visualize the data  On the right hand side Fields Menu, you would see a list of columns, as shown in the screenshot below.  Click on the checkbox next to SalesDate, Sales_Amt columns.  Click on the small arrow next to SalesDate in the Visualizations section. Select the SalesDate instead of Date Hierarchy.  Click on the Line Chart from the Visualizations section (1st icon on the 2nd Row)  Click anywhere on the page (white space outside the line chart, so that the line chart is not selected).  Select the checkbox next to ItemName under the Fields section.
  • 6. 6 | P a g e  You would see a list of Item Names appearing on Page. Move the ItemName section on the right side.  Adjust the Line Chart to look something like this. Select the ItemName list section on the right, and then select the Slicer (Filter Icon on the last row, 1st Icon) from the Visualization Section.  Change the text size of the ItemName Slicer to 12 from the the Visualization Section Navigation shown below.
  • 7. 7 | P a g e 3.5. Understand the data and trends  Select Think Pad 450s from the Slicer, and see the trend against time.  Select the Line Chart, and then select the Sales_Cost from the Fields.  From the top ribbon, under Home Menu, select Text Box, and add the heading - Daily Sales Trend. 4. Hands On #2 4.1. Creating a R visual  Create a new page by clicking on the + icon for the new page, at the bottom left side of the window. A new Page-2 is created.  Add a Slicer for ItemNames similar to the slicer in Page-1 (steps included in the above Hands on #1 section)  In the Visualization section, in the last row of the available charts, find the R script visual.  Click on the R script visual, then click on the Enable button, as shown below. Please note that if you don’t have R installed on your system, then download and install R from the following location: https://mran.revolutionanalytics.com/open/
  • 8. 8 | P a g e  The R visual will look something like this. Select Sales_Amt, Sales_Cost and Sales_Qty from the Fields section.
  • 9. 9 | P a g e  In the R script section of the visual, copy-paste the following code, and then click Run Script. Please note that you have to install.packges(‘ggplot2’), if you haven’t used ggplot2 package before. library(ggplot2) t<-plot(dataset)  Select Think Pad 450s from the slicer option. The plot would look like this: Congratulations!! You have successfully ran R script from Power BI.
  • 10. 10 | P a g e 4.2. Creating a Boxplot using R visual  Select another R visual on the same page, and then select ItemName, Sales_Qty and Discount.  Then write the following piece of code, in the R script area; then click on Run Script. boxplot(dataset$Sales_Qty, main="Boxplot", ylab="Sales_Qty")  Select Think Pad 450s from the slicer option. The plot would look like this:  To find a correlation between Sales_Qty and Discount, use # symbol to comment out the first line of code, then add the following piece of code, in the R script area; click on Run Script. Observe that the correlation between Discount and Sales_Qty #boxplot(dataset$Sales_Qty, main="Boxplot", ylab="Sales_Qty") boxplot(Discount~Sales_Qty,data=dataset, main="Boxplot", ylab="Sales_Qty")
  • 11. 11 | P a g e 4.3. Create a ggplot using R visual  Install the ggplot2 package using the R console. install.packages(‘ggplot2’)  Go back to Power BI, then create a new page by clicking on the + icon for the new page, at the bottom left side of the window. A new Page-3 is created.  In the Visualization section, in the last row of the available charts, find the R script visual.  Click on the R script visual, then click on the Enable button, as shown below.  Select another R visual on the same page, and then select ItemName, Sales_Qty and Discount.  Then write the following piece of code, in the R script area; then click on Run Script. library(ggplot2) ggplot(dataset, aes(x = ItemName , y = Sales_Qty,fill = ItemName )) + geom_bar(width = 0.85, stat="identity")
  • 12. 12 | P a g e 5. Hands on #3 5.1. Time series forecasting using ARIMA alogrithm  Create a new page by clicking on the + icon for the new page, at the bottom left side of the window. A new Page-4 is created.  Add a Slicer for ItemNames similar to the slicer in Page-1 (steps included in the above Hands on #1 section)  In the Visualization section, in the last row of the available charts, find the R script visual.  Click on the R script visual, then click on the Enable button, as shown below.  Select another R visual on the same page, and then select SalesDate, Sales_Amt.  Then write the following piece of code, in the R script area; then click on Run Script. Please install forecast and tseries R-packages if not already installed. library(forecast) library(tseries) ARIMA_Sales<-ts(dataset$Sales_Amt,start=c(1)) Sales_Forecast<-auto.arima(ARIMA_Sales, seasonal=TRUE) Predicted_Sales<- forecast(Sales_Forecast, h=10) plot(Predicted_Sales)
  • 13. 13 | P a g e 5.2. Time series forecasting using custom visual  Create a new page by clicking on the + icon for the new page, at the bottom left side of the window. A new Page-5 is created.  Add a Slicer for ItemNames similar to the slicer in Page-1 (steps included in the above Hands on #1 section)  From the Visualization section, click on the (…), and then select Import from store option. Please note that you need a Power BI account. You can sign-up for a free account using your corporate email id on powerbi.com  From the Advanced Analytics section, click on Add button against Forecasting with ARIMA.  You will see an additional visual appearing in the Visualizations section.  Click on the Forecasting with ARIMA visual, and then drag and drop the SalesDate in the Date section of the visual, and the Sales_Amt in the values section. Please be patient, it may take a few minutes to load.
  • 14. 14 | P a g e 5.3. Creating a predicted data table from R – ARIMA algorithm  Click on Edit Queries from the Home menu on the top of the window. A new window opens up like this.  In the Query Editor, click on the New Source -> More from the top of the window, and then click on the R Script.  Enter the following code in the R editor window. Please install forecast and tseries R- packages if not already installed. dataset <- read.csv('C:RRetail_Sales_Data.csv', header=TRUE, stringsAsFactors=FALSE) library(forecast) library(tseries) ARIMA_Sales<-ts(dataset$Sales_Amt,start=c(1)) Sales_Forecast<-auto.arima(ARIMA_Sales, seasonal=TRUE) Predicted_Sales<- forecast(Sales_Forecast, h=10) plot(Predicted_Sales) Predicted_Sales_Table <- data.frame(Predicted_Sales)
  • 15. 15 | P a g e  In the Navigator window, you would see an option to select the data or the output Predicted_Sales_Table. Select the second one.
  • 16. 16 | P a g e  You would see the predicted output table is added to the data model. Congratulations!! You have successfully learnt various methods of executing R scripts from Power BI.