Power BI has become an extremely popular tool for building reports and dashboards that your customers and clients will love. These can be interactive, and enable customers to perform analysis in an intuitive manner. There is
an online service to share reports as well as
integration with Reporting Services.
However, it can be pricey to create reports in the Power BI service for many people, especially those that want to experiment with a little data sharing with friends and family.
Grafana is an open source platform that is primarily used by administrators that want to visualize data about their systems. They create dashboards that can be easily displayed for other users to view and examine. It's available in a container and can be easily set up on a virtual machine that others can access for free.
Now we have a way to combine these two together and embed a Power BI visual inside of Grafana. This is a fantastic solution for those that want the power and flexibility of an open source visualization stack with the interactivity of a Power BI visualization.
NOTE: This is for only a single visual, not an entire report. I haven't found a way to get that working.
The Process
The overall process is fairly simple. We will use the Grafana Docker Image and customize it ourselves. The customization will make use of Power BI Desktop and a command line call to get this to run and embed a single report visual inside of the Grafana dashboard.
First, make sure you have a Power BI .pbix file with a single visual on a single report.
To start, get the
Grafana Docker image on your machine. Then we will create a docker compose that adds some custom items. Inside this file, we need a couple of volumes. One of these points to our powerbi desktop executable program folder, and the other points to our report folder. These are the pbiexe and pbidata volumes, respectively. A sample docker-compose..yml file looks like this:
version: "3"
services:
# My grafana service
grafana:
build:
context: ./grafana
container_name: grafana
ports:
- 9000:3000
volumes:
- grafana-data:/var/lib/grafana
- pbiexe:/var/lib/pbiexe
- pbidata:/var/lib/pbidata
# Explicitly define the persistent volume for your data storage
volumes:
grafana-data:
external: true
Then we need a docker file which will call this. The key is the /embed parameter being passed to the command line call.
FROM grafana/grafana:7.1.5-ubuntu
# Disable Login form or not
ENV GF_AUTH_DISABLE_LOGIN_FORM "true"
# Allow anonymous authentication or not
ENV GF_AUTH_ANONYMOUS_ENABLED "true"
# Role of anonymous user
ENV GF_AUTH_ANONYMOUS_ORG_ROLE "Admin"
# Install plugins here our in your own config file
# ENV GF_INSTALL_PLUGINS="<list of plugins seperated by ,"
# Get Power BI
RUN "/pbiexe/pbidesktop.exe /report='/pbiddata/myreport.pbix' /embed=true"
# Add provisioning
ADD ./provisioning /etc/grafana/provisioning
# Add configuration file
ADD ./grafana.ini /etc/grafana/grafana.ini
That's it. Now, when you start the Docker container, the pbidesktop.exe process will run separately in Windows, but be linked into the container. When you access the Grafana main dashboard, you'll see .... nothing. This is an April Fools joke. None of this actually works.
Hopefully you weren't too excited by the idea and not too disappointed now. But you can send this to your friends and get their hopes up if you want a laugh.