Our online Power BI trainings are conduced in a live, interactive environment. Before any Power BI online training, our team ensures that the attendees have all the tools downloaded in their local system. In this blog post, a step-by-step guide on downloading, installing and integrating python in Microsoft Power BI is presented.
Python is a programming language that is widely used by statisticians and data scientists. Python has simple syntax and a well-developed library-support that helps to filter, analyze and visualize complex data sets. To enhance user experience, Microsoft has integrated Python in the Power BI desktop. This chapter is not intended to teach you Python language but to demonstrate Power BI’s integration with Python.
Install Python
The Power BI tool does not contain python by default. You have to install Python on your computer before you can use it in Power Bi.
You may enable the option ‘Add Python 3.7 to PATH’ to add this into the environment or you may add it manually.
After successful installation of the setup, the following window will appear.
Install Python Packages
To successfully run Python in Power BI tool, you need to install two main Python packages using the command prompt:
Pandas
Matplotlib
We need to install the packages to use numerous prebuilt functions for data visualization and data manipulation operations. With the help of these packages, we can quickly get our desired output instead of writing long codes.
Pandas is an open-source, BSD-licensed Python library providing high-performance, and easy-to-use data structures and data analysis tools for the Python programming language.
1. Type the following command in command prompt.
Similarly, we need to install the Matplotlib plotting library for the Python programming language.
2. Type the following command in the command prompt.
Add Python Folder Path
Now we need to add the Python folder path in the environment variable
3. Go to Control Panel.
4.Click on System and Security.
5. Click on System.
6. Click on Advanced in System settings (in the left corner).
7. Click on Environment Variables.
In the Environment Variables, click ‘New’, and it opens a pop up box. Enter the below details in the edit user variable page.
Variable Name: PythonPath
Variable Value: C:\Users\rajen_000\AppData\Local\Programs\Python\Python37 (Change this Value according to your settings)
Verify Installation in Power BI
After installing Python, verify Python’s connection with Power BI using the Get Data feature.
Select Get Data from the Home tab and click on More
A subsequent window will display the list of all the data sources to which Power BI can connect.
2. From the list, select Python Script and click on Connect.
When you click Connect, the below window pops up. A path of your local library will be mentioned (as highlighted), which will verify that connection is successful. If connection is unsuccessful, an error will be displayed.
Conclusion:
Python is one of the most widely used programming language with a growing user base. Microsoft has integrated Python in Power BI and now python can be used for data analytics in Power BI. In this blog post, a step by step guide on downloading, installing and integrating python with Microsoft Power BI is presented.
More Checkouts for Power BI Training in Australia.