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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
DamianNew
New Member

Using python script in Power BI services

Hi Everyone,

 

I'd like to ask if anyone knows how to use python script in power bi services without personal gateway. I created some tranformations using python scripts, it works perfectly fine in power bi desktop but when I publish it to services it won't work without personal gateway. I'm not sure why is that ? 

My issue is conected with timezones, I'm using python function to convert datetime UTC (which power bi uses) to CET, when I publish table with two columns, first is DateTime.LocalNow() second is transformation which should make it different time zone (CET) but suprisingly when I'm publishing it to services DateTime.LocalNow() show my local time instead of UTC - probably it somehow contects to local machine and do some operations there 

2 REPLIES 2
Anonymous
Not applicable

Hi @DamianNew ,

If I understand correctly, the issue is that you want to use python script without personal gateway. Please try the following methods and check if they can solve your problem:

1.Power BI Service requires a data gateway to refresh datasets that include Python scripts.

 

2.Move the Python script as a web service to the Azure Machine.

 

3.Python as a visual doesn't need a Personal Gateway. You can view the following link.

Solved: Re: Using Python in Power BI without Personal Gate... - Microsoft Fabric Community

Create Power BI visuals using Python in Power BI Desktop - Power BI | Microsoft Learn

 

Best Regards,

Wisdom Wu

Anonymous
Not applicable

Hi, DamianNew,

If I understand correct you need the column in UTC datetime.
What if you use DateTimeZone.UtcNow() instead of  DateTime.LocalNow()?
Best,

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.