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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
h4tt3n
Helper V
Helper V

Getting Python data transformation scripts to work in PBI Service

I have a report that uses a Python script to transform timestamps from UTC to user / customer local time. The script runs in the Power Query environment and works perfectly in desktop, but I am having trouble understanding how to get it working in service.

 

I have read the following articles on how to use Python in PBI:
https://docs.microsoft.com/en-us/power-bi/connect-data/desktop-python-scripts
https://docs.microsoft.com/en-us/power-bi/connect-data/desktop-python-in-query-editor

https://docs.microsoft.com/en-us/power-bi/connect-data/refresh-scheduled-refresh

 

Questions:

 

  • What exactly is the purpose of the personal gateway. Why do I need it to run Python scripts?
  • Data is imported from an Azure db with SQL. Can I run the Python script from there?
  • Reports are running on a vm in Azure. Can I run the Python script on that machine?

 

Cheers, and have a nice day.

Mike

4 REPLIES 4
v-yingjl
Community Support
Community Support

Hi @h4tt3n ,

If you've fixed the issue on your own please kindly share your solution. If the above posts help, please kindly mark it as a solution to help others find it more quickly. Thanks!


Best Regards,
Yingjie Li

v-yingjl
Community Support
Community Support

Hi @h4tt3n ,

  1. Personal gateway is used to refresh your report in power bi service to ensure the data in the report is latest. Only running python scripts do not need gateway if you do not want to refresh report.
  2. & 3. As the document mentioned, you can select Run Python Script in power query editors to run python script whether the datasource comes for sql or azure.

 

Best Regards,
Yingjie Li

If this post helps then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@h4tt3n , power bi gateway is needed for power bi service to run python

https://powerbi.microsoft.com/en-us/blog/python-visualizations-in-power-bi-service/

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

I am sorry, but this is not very helpful. As clearly stated above, I have already read the documentation, and my questions remain unanswered. Challenge is still unsolved.

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.

Top Solution Authors