2.6 Python in Power BI: 2.6.1. Configuration
2.6 Python in Power BI: 2.6.1. Configuration
6 Python in Power BI
2.6.1. Configuration
• Install Python on your local or virtual machine:
https://www.python.org/downloads/
• When there is no R visual on the right visualizations panel, try the following steps:
File – Options and settings – Options – Preview features – R support;
Restart Power BI to get R Running.
2.7 R in Power BI
2.7.1. Configuration
• Check if R is installed by
clicking on File – Options
and settings – Options – R
scripting. If it’s installed,
then it will show a path
where it is installed.
2.7 R in Power BI
2.7.2. Import the dataset into Power BI
Same methods as using Python script to import datasets into Power BI, we can import datasets
directly or using R script or manually.
2.7 R in Power BI
2.7.3. Create R visuals
1) Select the R visual icon in the Visualization pane and select Enable.
2.7 R in Power BI
2.7.3. Create R visuals
2) Click the Run Script Button in the Visualization pane and select Enable.
2.7 R in Power BI
2.7.3. Create R visuals
3) Drag fields to the Values
section.
Note:
a) Your R script can only use
fields added to the Values
section.
b) Duplicate rows will be
removed from the data. You
can remove the row “dataset
-> unique(dataset).” if you
need all the rows of your
datasets.
2.7 R in Power BI
2.7.3. Create R visuals
4) Add R code and use the selected data to create plots.
We use the following code to create a line plot.
References:
1. https://docs.microsoft.com/en-us/power-bi/desktop-python-scripts
2. https://docs.microsoft.com/en-us/power-bi/desktop-python-visuals
3. https://docs.microsoft.com/en-us/power-bi/desktop-python-ide
4. https://docs.microsoft.com/en-us/power-bi/desktop-r-scripts
5. https://docs.microsoft.com/en-us/power-bi/desktop-r-visuals
6. https://docs.microsoft.com/en-us/power-bi/desktop-r-ide