Power BI

Create a Violin Plot in Power BI using Python

Create-A-Violin-Plot-In-Power-BI-Using-Python

Python is included in our advance Power BI training course because python has become the go-to tool for data analysts and data scientist across the globe. This preposition has been further strengthened by integration of Python with Power BI. Now you can create stunning visuals by coding in python language inside the Power BI desktop tool. However, if you’re new to this then you must read and practice the steps in the following blogs before starting to create a violin plot:

This blog post assumes that the reader has already installed python along with the required libraries on their local system.

Data set used:

For this section, you need to download the IRIS dataset which is publicly available.

Introduction to Seaborn Library

Seaborn library in Python is built on the top of Matplotlib library and is developed solely for visualization purposes.  Seaborn is used to build beautiful visualizations and helps in analyzing the data.

Start Scripting:

  1. Select Visualization Tab under the Visualizations Pane.
Power BI Training in Adelaide - Create A Violin Plot In Power BI Using Python

2. Click on Python Visual. The following window will appear.

Power BI Training in Melbourne - Create A Violin Plot In Power BI Using Python

3. Click on Enable to enable Python Scripts. The following window will appear.

Power BI Training in Sydney - Create A Violin Plot In Power BI Using Python

Python script editor automatically creates the dataset using the library Pandas. It creates the data frame with required column fields.

Create a Violin Plot

Violin plots are used to visualize the distribution of numeric variables for one or multiple groups, it allows to understand the density more deeply. It is an upgraded version of the box plot. The violin plot is showing a relationship between the petal width and petal length of the data points. Its showing that the data set does not have a continuity in the values. Most the points are distributed where the petal length is greater than 3. To use Violin plots you have to install Seaborn library, it is another data visualization library provided by python to generate high-level statistical graphs.

1. Open the Python editor. 

2. Enter the code as shown in the screenshot below.

Power BI Training in Perth - Create A Violin Plot In Power BI Using Python

3. The above generates the following plot.

Power BI Training in Brisbane - Create A Violin Plot In Power BI Using Python

Conclusion:

Seaborn is python library built on the top of Matplotlib library. Seaborn is developed to assist data visualization for python users. Power BI has integrated python into this desktop tool. Therefore, seaborn can be used for coding inside the Power BI desktop and construct beautiful visuals. Violin plot is used to understand the distribution of the variables. Violin plots are like box plots except that they show the density of the variables around different values. In this blog post, a step by step guide on creating violin plot in Power BI using python has been presented.

Are you a data analyst and want to learn more about Power BI?

Why not sign up for Power BI training in Australia.  We provide our services in the following regions:

Back to list

Leave a Reply

Your email address will not be published. Required fields are marked *