Forum Discussion
edit graph
Hi Anonymous ,
You can do it by writing python scripts. First, please refer to this document to install Python and connect to the data source. Run Python scripts in Power BI Desktop
Then use the following script in the Python visual.
import numpy as np
import matplotlib.pyplot as plt
y = dataset.ID
x = dataset.value
# Default Settings
b = plt.barh(y, x)
for rect in b:
w = rect.get_width()
plt.text(w, rect.get_y()+rect.get_height()/2, '{:.0%}'.format(w), ha='left', va='center',fontsize=20)
plt.xticks([0.05, 0.5,0.9, 1],['$on process$', '$continue$', '$On the way$','$Completed$'])
plt.grid(axis="x", which="major",linestyle='-.')
plt.title('custom')
plt.xlabel('xlabel name')
plt.ylabel('ylabel name')
plt.show()If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
v-kkf-msft Please send file pbix to me.
- v-kkf-msft5 years agoCommunity Support
Hi Anonymous ,
This is my PBIX file.
- Anonymous5 years agoNot applicable
- v-kkf-msft5 years agoCommunity Support
Hi Anonymous ,
You must install Python on your computer to execute these scripts. Because desktop does not have built-in Python.
Run Python scripts in Power BI Desktop
If you are opening my PBIX file, when you see the prompt in the figure below, you need to click Enable to load it.
If you want to apply it in your PBIX file, you need to modify the ID and value to the fields in the table imported.
If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
WinnizIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.