Dashboard creation with Python and Power BI

Integrating Python with Power BI in a data pipeline

Justin Morgan Williams
7 min readFeb 21, 2024
Photo by Lukas Blazek on Unsplash

Background

My interest in Data Science and Analysis skyrocketed once I learned Python. I fell in love with Jupyter Notebooks ability to contain markdown text, write, and run code all within the same document. The luster quickly faded, when after landing my first data analyst job, I realized firing up a Jupyter Notebook for stakeholders wasn’t exactly a seamless process. I eventually learned how to construct apps with both Dash and Shiny, however I couldn’t use these with confidential company data. Therefore, I was bound to the Microsoft O365 environment, so I forged ahead and decided to find a solution to the question that spurned this very blog:

How can I integrate Python and Power BI?

Workflow

Ideally, I wanted to somehow trigger Python scripts arranged in a package from Power BI. This would mimic the way I had implemented workflows prior, with R and Python scripts being triggered using VBA (Visual Basic for Applications) in Excel (you can read about my process in Call Python and R Scripts From Excel ). However, I had a different journey ahead of me.

I did some Google searches, read the Power BI documentation, and all I could seem to find about…

--

--

Justin Morgan Williams

Data scientist passionate about the intersectionality of sustainability and data.