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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. 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
v-shex-msft
Community Support
Community Support

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

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.