top of page

Embedding PowerBI Dashboard In A Streamlit Web App

Updated: Mar 13

Authors: Shikha Bhagat & Sarik Anwar



https://devscope.files.wordpress.com/2018/06/devscope-powerbi-robots-reports-in-powerpoint-v01_artboard-53.png?w=825&h=510&crop=1

Power BI service

The Power BI service is a secure cloud-based service offered by Microsoft, which can be accessed by users. Through this service, users can view various types of data visualizations, such as dashboards, reports, and Power BI apps. Power BI apps are a special kind of content that brings together related dashboards and reports and can be accessed through a web browser or mobile applications designed for Windows, iOS, and Android devices.


Introduction


Streamlit is a web application framework designed specifically for use in Machine Learning and Data Science. The framework is open-source, and it has been tailored to provide users with the necessary tools and resources required for these fields. In this blog post, I’ve incorporated a range of high-quality tools and frameworks into a Streamlit web application.


Prerequisites

We have attempted to include some excellent tools and libraries in a Streamlit Web App in this blog.


Required Services:

  • PowerBI Web Service

Required Libraries:

  • NumPy

  • pandas

  • streamlit

Let’s start with PowerBI. Below given is a simple dashboard made using PowerBI on a B2C dataset.



Once we have the dashboard, we need to get a link to embed it in the streamlit app. To fetch the URL, go to File → click on Publish to Web → click on website or portal.



This will generate a link that can be copied and pasted into the web app to render the dashboard. You can adjust the dashboard's size to your preference. Copy the HTML URL as shown below.



Moving forward, let’s build our web app using streamlit. For the purpose of making the dashboard customer-oriented and ensuring that only customers can access it, we are storing this iframe link in a table that is residing in Snowflake.



The above code gives you the below results.



The dashboard is divided into three sections which are namely the User Profile, Recommendation based on stocks, and Sector-based Stocks. The st.selectbox option helps us to create a dropdown menu that consists of all the above options. Moving ahead, let’s connect our PowerBI report to the app.



Once you perform the above step, the web app will be able to render the report, and it will look like the image below.



Conclusion

By embedding the dashboard link made using PowerBI on streamlit web app, we can view that dashboard on streamlit web app.


1,567 views0 comments

Recent Posts

See All
bottom of page