This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreLevel up your Power BI skills this month - build one visual each week and tell better stories with data! Get started
When running the script the visual displays "Can't display this visual. See details"
I click it and it says:
Python script error.
<pi> File "PythonScriptWrapper.PY", line 18
dataset = pd.DataFrame(DT , DT Code)
^
SyntaxError: invalid syntax
</pi>
I have the following code.
1 # The following code to create a dataframe and remove duplicated rows is always executed and acts as a preamble for your script:
2 import pandas as pd
3 dataset = pd.DataFrame(DT , DT Code)
4 # dataset = dataset.drop_duplicates()
5 import matplotlib.pyplot as plt
6 dataset.plot(kind='bar',x='DT)',y='DT')
7 plt.show()
Lines 1,3,4 are auto generated when I click and drag my data into the python visual. I impetrated pandas to try and fix the issue i have
I plot DT vs DT since I know they are the same length and that way I know there is not a plotting error.
I have pandas, numpy, and matplot lib installed and have even referenced my script to a new env instead of my root python to try to get it to work. I am using python 3.8.
Hi @Anonymous
Which version of the Pandas package are you using?
Regards,
Community Support Team _ Jing
Check out the April 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 28 | |
| 23 | |
| 22 | |
| 16 | |
| 16 |
| User | Count |
|---|---|
| 60 | |
| 35 | |
| 28 | |
| 22 | |
| 21 |