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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
my_patil
Regular Visitor

Change Python script data source to Postgresql in Power BI

Hi friends,

currently I used Python scripts as datasource in my Power BI dashboard where data is coming from Odoo server. Now I have set up Postgresql as staging database but I don't know how to change data source from Python script to Postgresql. When I click on data source setting in power query then select python script then it doesnot show change source option.Please help me to how to achive this.Thanks in advance!!

 

my_patil_0-1777267826852.png

 

1 ACCEPTED SOLUTION
grazitti_sapna
Super User
Super User

Hi @my_patil,

 

Yes — this happens because Python Script is treated as a special source type in Power BI. Unlike SQL/Excel/Web sources, it usually does not expose a normal “Change Source” button in Data Source Settings.

To move from Python script (Odoo API pull) to PostgreSQL staging DB, you’ll need to replace the source inside Power Query Editor.

 

What you can do it create a query in Transform data, connect it to the Postgresql source and load the required table. now go to advance editor and copy the source code, for e.g.

 

let
Source = PostgreSQL.Database("ServerName","DBName"),
sales_orders = Source{[Schema="public",Item="sales_orders"]}[Data],
ChangedType = ...
FilteredRows = ...
in
FilteredRows

 

Copy the first lines where you are connecting to the table and replace your older version source (Python script) with these lines, Make Sure "Keep all transformation steps and only replace Source step."

 

🌟 I hope this solution helps you unlock your Power BI potential! If you found it helpful, click 'Mark as Solution' to guide others toward the answers they need.
💡 Love the effort? Drop the kudos! Your appreciation fuels community spirit and innovation.
🎖 As a proud SuperUser and Microsoft Partner, we’re here to empower your data journey and the Power BI Community at large.
🔗 Curious to explore more? [Discover here].
Let’s keep building smarter solutions together! 

View solution in original post

3 REPLIES 3
grazitti_sapna
Super User
Super User

Hi @my_patil,

 

Yes — this happens because Python Script is treated as a special source type in Power BI. Unlike SQL/Excel/Web sources, it usually does not expose a normal “Change Source” button in Data Source Settings.

To move from Python script (Odoo API pull) to PostgreSQL staging DB, you’ll need to replace the source inside Power Query Editor.

 

What you can do it create a query in Transform data, connect it to the Postgresql source and load the required table. now go to advance editor and copy the source code, for e.g.

 

let
Source = PostgreSQL.Database("ServerName","DBName"),
sales_orders = Source{[Schema="public",Item="sales_orders"]}[Data],
ChangedType = ...
FilteredRows = ...
in
FilteredRows

 

Copy the first lines where you are connecting to the table and replace your older version source (Python script) with these lines, Make Sure "Keep all transformation steps and only replace Source step."

 

🌟 I hope this solution helps you unlock your Power BI potential! If you found it helpful, click 'Mark as Solution' to guide others toward the answers they need.
💡 Love the effort? Drop the kudos! Your appreciation fuels community spirit and innovation.
🎖 As a proud SuperUser and Microsoft Partner, we’re here to empower your data journey and the Power BI Community at large.
🔗 Curious to explore more? [Discover here].
Let’s keep building smarter solutions together! 

Hi @my_patil ,
Thanks for reaching out to the Microsoft fabric community forum. 


I would also take a moment to thank  @grazitti_sapna , for actively participating in the community forum and for the solutions you’ve been sharing in the community forum. Your contributions make a real difference. 
I hope the above details help you fix the issue. If you still have any questions or need more help, feel free to reach out. We’re always here to support you.

Best Regards, 
Community Support Team

Hi @my_patil ,

I hope the above details help you fix the issue. If you still have any questions or need more help, feel free to reach out. We’re always here to support you.

Best Regards, 
Community Support Team

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

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.

Top Kudoed Authors