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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Anonymous
Not applicable

Unreliable Python Visual

Hello everybody,

I've had issues with a couple of dashboards, trying to display python figures. Data sources are excel files.

These are quite simple and actually work in the Spyder environment.

 

Here are the issues I am facing : 

 

-Spyder environment code

ThoVez_6-1665471422884.png

 

-PowerBI execution :

ThoVez_7-1665471555280.png

 

Another Example : 

 

Here is the graph in Spyder: 

ThoVez_3-1665470461747.png

Here is in PowerBI : 

-

 

ThoVez_2-1665470383740.png

It seems that the order in which powerbi is plotting is not actually following the script (dots are link in a very horizontal looking first example, and in the second one the order of plotted lines just makes no sens (I tried with different number of plots, unless having just one line plotted, order is wrong).

In both cases, the different plot functions are called in a "for" loop.

Second example is a Gantt chart I had to code in Python because I want it to have features not available in "already built" Gantt charts (both in powerbi and python librairies).

As the scripts are just copied and pasted, I think this has to do with the internal behaviour of Python in PowerBI.
Does it mean "complex" plots are just impossible ?

Did I miss some parameter somewhere? 

Both are running the same Python.exe : 

 

ThoVez_0-1665476401912.png

ThoVez_1-1665476442700.png

 

 

 

 

Thanks a lot

 

 

1 REPLY 1
Anonymous
Not applicable

Hi @Anonymous,

In fact, power bi python visual is a light version of python. It can be worked with some python scripts but power bi also limits these script usage and calculation ranges. (for security and performance reasons)

I'd like to suggest you take a look at the following document limitation parts if helps:

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

Regards,

Xiaoxin Sheng

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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