Where does the place run the Python script in Power BI?

167 Views Asked by At

I created a Power BI report using Power BI Desktop and shared it on the Power BI service. To ensure the on-premises data in the report stays up to date, I employed the Power BI personal data gateway for auto-refreshing. The Python script is used to import on-premises data into the Power BI data model. I want to know where the place runs the Python script. on Power BI personal data gateway or on Power BI service?

1

There are 1 best solutions below

0
On

Steps to setup Python in Power BI:

  1. Click 'File' in the upper left corner.

enter image description here

  1. Click 'Option and settings'. Click 'Options'.

enter image description here

  1. Click 'Python scripting'

enter image description here

  1. Change Directories and Navigate to Your Python Environment

enter image description here

How to use Python

  1. Click Get data

enter image description here

  1. Search for Python Script and Click to Open a New Coding Window.

enter image description here

  1. Type in the Below Code and Click Ok.

enter image description here Power BI Service with Python as Data source:

Based on this document, It is not supported to implement schedule refresh via on premise Data Gateway (Enterprise Gateway) for Python in Power BI Service currently .

  1. To enable scheduled refresh of your Python dataset, you need to enable Scheduled refresh and have a Personal Gateway installed on the computer that houses the workbook and the Python installation.
  2. You'll need to have the pandas library installed in your Python environment for the previous script code to work properly.
  3. For the Python scripts to work properly in the Power BI service, all data sources need to be set to public.
  4. Nested tables (table of tables) are currently not supported.

Python script execution on the Power BI Desktop and personal gateway has the same dataframe size and PNG image size limits, but the execution time limit is 300 seconds. Other constraints are not applicable to Power BI Desktop and personal gateway. Please refer to this blog: https://powerbi.microsoft.com/en-us/blog/python-visualizations-in-power-bi-service/