Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
pennyhoho117
Helper IV
Helper IV

Power Bi can call python script?

1. We have write some python script in Power BI Report (pbix) and publish to Power BI Service, but there is error said gateway not config correctly. i checked from power bi community, on-premises gateway cannot call python if a report involves python script?

2. if in Power Automate Cloud platform, can call python script, i mean if a python script file putted on the on-premise gateway server, then Power Automate can call the python script file through the on-primise gateway? if not can suggest anyway to call a python script?

1 ACCEPTED SOLUTION
v-saisrao-msft
Community Support
Community Support

Hi @pennyhoho117,

Thank you for reaching out to the Microsoft Fabric Froum Community.

 

I understand that you are experiencing an issue where your Power BI report (PBIX) containing a Python script runs locally but fails in Power BI Service due to a gateway configuration error. Additionally, you are inquiring whether Power Automate Cloud can execute a Python script stored on an on-premises server via the on-premises data gateway. 

Allow me to address both of your concerns: 

  1. Power BI Desktop supports Python scripts. However, when published to Power BI Service, Python scripts need a Personal Gateway instead of an on-premises data gateway. The on-premises data gateway does not support Python execution in Power BI Service, which is why you are encountering a gateway-related error.   
  2. Power Automate is unable to directly run a Python script via the on-premises data gateway. 
  • Utilize Power Automate Desktop to execute Python scripts on a local machine.
  • Power Automate Cloud is unable to run Python scripts directly through the on-premises gateway. Instead, consider using Azure Functions or triggering the script indirectly. Power Automate Desktop can execute local Python scripts.

  

Please refer to the link below for a better understanding: 

Use a personal gateway in Power BI - Power BI | Microsoft Learn 

Use Python v3 in Power Automate for desktop | Microsoft Learn 

 

If this post helps, then please give us ‘Kudos’ and consider Accept it as a solution to help the other members find it more quickly.   

   

Thank you. 

View solution in original post

4 REPLIES 4
v-saisrao-msft
Community Support
Community Support

Hi @pennyhoho117,

 

We haven’t heard back from you regarding your issue. If it has been resolved, please mark the helpful response as the solution and give a ‘Kudos’ to assist others. If you still need support, let us know.

 

Thank you.

v-saisrao-msft
Community Support
Community Support

Hi @pennyhoho117,

 

May I ask if you have resolved this issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.

 

Thank you.

v-saisrao-msft
Community Support
Community Support

Hi @pennyhoho117,


I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions. If my response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.


Thank you.

v-saisrao-msft
Community Support
Community Support

Hi @pennyhoho117,

Thank you for reaching out to the Microsoft Fabric Froum Community.

 

I understand that you are experiencing an issue where your Power BI report (PBIX) containing a Python script runs locally but fails in Power BI Service due to a gateway configuration error. Additionally, you are inquiring whether Power Automate Cloud can execute a Python script stored on an on-premises server via the on-premises data gateway. 

Allow me to address both of your concerns: 

  1. Power BI Desktop supports Python scripts. However, when published to Power BI Service, Python scripts need a Personal Gateway instead of an on-premises data gateway. The on-premises data gateway does not support Python execution in Power BI Service, which is why you are encountering a gateway-related error.   
  2. Power Automate is unable to directly run a Python script via the on-premises data gateway. 
  • Utilize Power Automate Desktop to execute Python scripts on a local machine.
  • Power Automate Cloud is unable to run Python scripts directly through the on-premises gateway. Instead, consider using Azure Functions or triggering the script indirectly. Power Automate Desktop can execute local Python scripts.

  

Please refer to the link below for a better understanding: 

Use a personal gateway in Power BI - Power BI | Microsoft Learn 

Use Python v3 in Power Automate for desktop | Microsoft Learn 

 

If this post helps, then please give us ‘Kudos’ and consider Accept it as a solution to help the other members find it more quickly.   

   

Thank you. 

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.