Python Invades Power BI, Again
I don't like snakes either, but I love Python programming (these colors are also similar to the official Power BI palette!)

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

No alt text provided for this image

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.

No alt text provided for this image

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.

No alt text provided for this image

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

No alt text provided for this image

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

Francisco Ruiz Mayoral

Control Gestión Comercial

2 年

Gracias por el aporte Helen Wall Es impresionante lo que está creciendo Python, y lo que nos puede aportar.

POOJA JAIN

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

要查看或添加评论,请登录

Helen Wall的更多文章

  • Flying on Autopilot

    Flying on Autopilot

    I remember taking a plane flight several years ago with a roller coaster landing. It was an otherwise uneventful short…

    2 条评论
  • Releasing Snakes into the Wild

    Releasing Snakes into the Wild

    This week brings big news in both the Excel and Python communities! Python in Excel is now generally available as of…

    4 条评论
  • Slithering Back In

    Slithering Back In

    I'm finally catching up on the latest editions of my newsletter after a bit of a break. Writing newsletters or any kind…

    2 条评论
  • The Modern Updates

    The Modern Updates

    As I was perusing potential updates for my home recently, I started to think about how the definition of "modern" will…

  • WINDOWs of the World

    WINDOWs of the World

    It's really hard to get very far in data science without knowing SQL. Within SQL there are different levels of…

    3 条评论
  • Straightening Things Out

    Straightening Things Out

    When I took linear algebra in college, my favorite part of the class was the end of it. The course was highly…

    2 条评论
  • SWITCH It Up

    SWITCH It Up

    In order to master managing data models, learning how to leverage conditional logic is a must. We see conditional logic…

    3 条评论
  • Seeing Dots

    Seeing Dots

    I use data visualizations not only to communicate data models to end-users who are stakeholders, but I also personally…

    5 条评论
  • The Digital Rolodex

    The Digital Rolodex

    A few months ago, I was doing my civic duty as part of a potential jury panel. While we were waiting for the court to…

    4 条评论
  • Making the "Old" New

    Making the "Old" New

    I talk with a lot of people about whether their organization uses custom visuals in Power BI. Their answers often vary…

    4 条评论

社区洞察

其他会员也浏览了