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

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

Reply
SriGaG
Frequent Visitor

Python visualizations in power bi -Issues with the visuals

 Hello experts,

 

I am running in to an error of ordering the month in power b visuals in python scripting.

 

boPQr.png

 

Here is the code i am referring.

Can anyone help me to find me the way of ordering this on the pbi visual?

import matplotlib.pyplot as plt 
ax = plt.gca() 
dataset.plot(kind='line', x='Month', y='cases', color='red',ax=ax)
dataset.plot(kind='line', x='Month', y='deaths', color='green', ax=ax)
plt.show() 

when look in to the green line, it also not categorized clearly. can you help me on this?

And when i selected date, why the chart behaves like this?

 

6R4bm.png 

My expectation was a flowing line chart on the visual. I have selected the current monthe in the filter.  This shows the data from Aug 1 to Aug 20, 2021. 

 

1 REPLY 1
lbendlin
Super User
Super User

instead of 

x='Month'

you should have something like 

x='YearMonth'

 

Looks like your date filter does not impact the data frame. Check your data model. 

Helpful resources

Announcements
October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.

Top Kudoed Authors