Python Invades Power BI, Again
Like the invasive Burmese Python population that unfortunately continues to cause massive irreparable harm to the Florida Everglades ecosystem, the Python language also continues to rapidly grow. But unlike the actual snake population, the ever-increasing popularity of this programming language is a great thing to see! I already love Python for its elegance, but its integrations with tools like Power BI only continue to add to its appeal.
Want to create a Power BI visual with Python code?
In the latest video of my Power BI Weekly course series, I show how to build a visual using a custom Python script with the standard Power BI Python visual.
Here's the direct link: https://www.dhirubhai.net/learning/power-bi-weekly/integrating-python-scripts-into-visuals
Power BI directly supports Python libraries like matplotlib and seaborn in the Power BI service. Here's an example of a dendrogram we can use to visualize the results of a hierarchical clustering model. The Python code to create this visual is in the exercise files for this course! Could I further improve the formatting for this visual? Absolutely, but a visual like this is a great starting point for seeing how this model works!
Looking for more Python options?
Microsoft created Power BI as an application that builds upon their own existing tools like Power Query (first made available in Excel), SQL Server Analysis Services, and DAX (first debuted in PowerPivot). Power BI also offers an impressive array of external tools we can configure within the application, whether that's low code options like Mapbox or ArcGIS/Esri map visuals or writing our code (in R or Python). For both languages, there are a number of places where we can create these custom scripts, either after or before we load the data into Power BI. In the Power Query Editor, we can use Python for connecting to a data source and transforming the data table (either for a new query or on an existing one). These options let us combine customized Python scripts with the versatile and useful
In the middle two columns of the graphic below, we see how to run Python scripts in the Power Query Editor within Power BI both for extracting data from the original source and transforming it, and also for running a Python script on existing queries. With either approach, we can combine Python with the incredibly useful built-in functions of Power Query.
One challenge with integrating Python (or R) into Power BI is that we might see a latency for updates, especially for large data tables. If your refreshing schedules in the Power BI service can no longer keep up with the demands of the business, pushing those models into the data source can improve performance, even if it takes more time to initially configure these models.
Power BI integrated R into its toolbox before it integrated Python, which we can see in the disparity of the number of available libraries for R compared to Python. The Python libraries though are some of the most common ones for modeling and data visualization, so there's no shortage of development options, even with just a few packages!
Looking forwards and backwards
Up next week in the Power BI Weekly series: using bookmarks and buttons to create some really neat interactivity.
Last week, uses built-in text analytics algorithms like score sentiment directly in Power BI to analyze the positive or negative sentiment in pieces of text. I wrote reviews for London's fictitious Landon Hotel, but the inspiration for these examples came from one-star National Park Yelp reviews, like the one we see on the right. I don't believe the newsletter email went out last week, so check out the newsletter link above!
-HW
Control Gestión Comercial
2 年Gracias por el aporte Helen Wall Es impresionante lo que está creciendo Python, y lo que nos puede aportar.
Web UI Developer
2 年??
PhD Candidate[Info.Sec Engineering] / DEng
2 年The Beyondof Power BI...:??"Power DI"?? https://www.dhirubhai.net/posts/khoshnoodiiust_decisionintelligence-bussinessintelligence-activity-6930291030177030144-g7Zc?utm_source=linkedin_share&utm_medium=android_app
Storyteller | Linkedin Top Voice 2024 | Senior Data Engineer@ Globant | Linkedin Learning Instructor | 2xGCP & AWS Certified | LICAP'2022
2 年Insightful share???? Helen Wall
Congratulations Helen for everything you post by using Python / R with Power BI