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
henrypost
New Member

Python editor overhaul - PowerBI

PowerBI has big quality issues with the Python editor. I'm used to PyCharm/IDLE/the Python REPL, and found it very hard to diagnose Python scripts, interpret errors, or even make small changes to them in PowerBI.
 
1. When you go to "Get Data > More > Python Script", you are only allowed to paste a Python script in. You can't use a file on disk. PowerBI forces you to embed a static script in PowerBI. This is annoying because it'd be nice to maintain a file-based repo of Python scripts, instead of embedding them in the .pbix file.
 
2. If I want to edit the imported Python script, you get a terribly hard to read block of text:
 
let
    Source = Python.Execute("import pandas as pd#(lf)#(lf)# Example data#(lf)data = {#(lf)    'Category': ['Electronics', 'Electronics', 'Furniture', 'Furniture', 'Office Supplies', 'Office Supplies'],#(lf)    'Sub-Category': ['Phones', 'Laptops', 'Chairs', 'Tables', 'Paper', 'Binders'],#(lf)    'Sales': [5000, 7000, 3000, 4000, 1000, 2000],#(lf)    'Profit': [1500, 2000, 500, 800, 200, 600],#(lf)    'Date': ['2024-01-01', '2024-02-01', '2024-01-01', '2024-02-01', '2024-01-01', '2024-02-01']#(lf)}#(lf)#(lf)# Create the DataFrame#(lf)df = pd.DataFrame(data)#(lf)#(lf)# Convert Date column to datetime#(lf)df['Date'] = pd.to_datetime(df['Date'])#(lf)#(lf)print(df)#(lf)"),
    df1 = Source{[Name="df"]}[Value]
in
    df1
 
 
3. Error logs have no history: If I have a Python error, I can't easily diagnose it from within PowerBI or debug it. I have to open a separate text editor, hope that I saved my original Python script, run it in my own REPL, and also copy the error to an external text editor.
 
4. No stdout: If my script prints to stdout, I can't view it.
 
I could go on, but I think the main point stands: Debugging or editing PowerBI Python scripts is really painful. Even an IDLE-like interface would be amazingly useful.
 
Alternatively, a community guide on "How do I develop complex Python scripts within PowerBI and test them" would be useful. Perhaps Microsoft could make a Github repository that has a flow set up.
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi, @henrypost 

It's true that the current version of Power Query doesn't support the features you describe, and there are a few flaws with it. You can submit an idea for here and vote it, the product team will take note of such a need.

Related Link: New tab (powerbi.com)

If your requirements can be done in Power BI Desktop instead of Power Query, you can use an external IDE to help you edit the code more easily.
Use an external Python IDE with Power BI - Power BI | Microsoft Learn

vyaningymsft_0-1733194150364.png

 

Best Regards,
Yang

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know.
Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi, @henrypost 

It's true that the current version of Power Query doesn't support the features you describe, and there are a few flaws with it. You can submit an idea for here and vote it, the product team will take note of such a need.

Related Link: New tab (powerbi.com)

If your requirements can be done in Power BI Desktop instead of Power Query, you can use an external IDE to help you edit the code more easily.
Use an external Python IDE with Power BI - Power BI | Microsoft Learn

vyaningymsft_0-1733194150364.png

 

Best Regards,
Yang

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know.
Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

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.