Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hi,
I am looking for a method to load several image with Python scipt into Power BI desktop to create a dashboard. I don't want to manually select images and import them. Here is my current code and the power bi failed to recognize the image. I am using Get Data with Python Script. Is there a way to solve this issue? Or is there any alternative detailed methods to import images with script into Power BI?
import pandas as pd
import json
import matplotlib.pyplot as plt
import matplotlib.cbook as cbook
#ax=plt.gca()
with cbook.get_sample_data('D:/carapace/TableauChartDisplayTask/test.png') as image_file:
image=plt.imread(image_file)
fig, ax = plt.subplots()
fig.figimage(image)
#fig.figimage(image, 10, 10, zorder = 3, alpha =.5)
plt.title('matplotlib.pyplot.imread() function Example',
fontweight ="bold")
plt.show()
And here is the result
Thank you
Solved! Go to Solution.
matplotlib.pyplot.imshow — Matplotlib 3.5.2 documentation
import matplotlib.pyplot as plt
import matplotlib.image as img
image = img.imread('c:\\users\\xxx\\downloads\\IMG_20180323_083209.jpg')
plt.imshow(image)
plt.show()
Hi @Eraclea ,
You should use the Python visual rather than python script.
Best Regards
Community Support Team _ chenwu zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
matplotlib.pyplot.imshow — Matplotlib 3.5.2 documentation
import matplotlib.pyplot as plt
import matplotlib.image as img
image = img.imread('c:\\users\\xxx\\downloads\\IMG_20180323_083209.jpg')
plt.imshow(image)
plt.show()
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
65 | |
63 | |
52 | |
37 | |
36 |
User | Count |
---|---|
82 | |
66 | |
61 | |
46 | |
45 |