Sankey chart for flow visualization in Power BI

Yannawut Kimnaruk
4 min readJul 10, 2022

--

Get to know a Sanket chart

The Sankey chart is a beautiful visualization used to illustrate a flow of data from multiple levels and to multiple destinations. The things being connected are called nodes and the connections are called links.

The Sankey plot is usually used to show website/application traffic among the pages.

There are several ways to create a Sankey plot such as a Sankey generator website, Python/R programming, and visualization tools. Among these methods, Power BI is the most convenient for tabular data in my opinion since it can create a Sankey plot in a short time without coding. Moreover, a Sankey plot created by Power BI is easy to adjust and interactive with other data in the table.

Step summary

  1. Get data
  2. Download Sankey visual
  3. Create a Sankey chart
  4. Adjust the Sankey chart

1. Get data

I used a sample dataset that is the number of passengers traveling from one country to another.

Dataset sample

Open Power BI. Click the Home tab, select Getdata, and select Text/CSV.

Home tab > Get data > Text/CSV

Then, select the downloaded .csv file and Load the data.

2. Download Sankey visual

In the Visualizations plain on the right-hand side, click at 3 dots and select “Get more visuals”

Visualizations plain >3 dots > “Get more visuals”

This will open the visual marketplace. Search for Sankey Chart using the search area on the right-hand side. Click on the Sankey Chart product (please make sure that it is the same one as the below image). Then, click Add.

Search Sankey Chart > Click Sankey Chart > Add

Now, you will see the Sankey icon in the Visualizations plain.

3. Create a Sankey chart

Click on the Sankey icon in the Visualizations plain.

You will see an empty visualization.

Empty visualization

In the Fields plain on the right-hand side, drag 3 columns in which you want to create a Sankey. These columns must be dragged to Source, Destination, and Weight in the correct category (weight must be a number).

❗ Make sure that you have selected that empty visualization before selecting the column.

A Sankey plot will be created.

The number of passenger is represented by the weight of the link between nodes and the total number traveling to each country is shown by the node size.

Click Sankey icon > Select columns

4. Adjust the Sankey chart

  • Expand the chart by dragging the angle or side.
  • Turn on the Data link label

Visualizations plain > Data link labels On

You can do this by selecting a Sankey chart. Then, in the Visualizations plain, click on Format your Visual icon. Turn the Data link labels On. You will see the text on the links that show their connected nodes.

  • Node & Link color change

Visualizations plain > Links/Nodes>Select color

You can adjust the color of each node and link manually in the Visualization plain.

As you can see that creating a Sankey plot from Power BI is so simple yet beautiful.

If you like this article, please clap and follow me for more articles about data science.

--

--

Yannawut Kimnaruk
Yannawut Kimnaruk

Responses (1)