THE SQL Server Blog Spot on the Web

Welcome to - The SQL Server blog spot on the web Sign in | |
in Search

John Paul Cook

BI Beginner: Stacked Charts in Power BI

People new to Power BI Desktop have asked me how to create a columnar chart where each column has different colors for different values stacked on top of each other. There’s no reason to be intimidated. Creating such a chart is very simple with only two additional requirements since yesterday’s port. First, your input data must classify the data into groups. You’ll either need groups specified in the data or be able to classify the data into groups based on some criteria. Today the sample data has two columns of sales data, one for sales of Widget A, and the other for sales of Widget B.


Figure 1. Sales data for Widget A and Widget B instead of total overall sales.

Second, you must chose an appropriate visualization. Not all visualizations are suitable for stacking different data values on top of each other. You’ll need a visualization that has stacked within the visualization’s name. You want stacked data, so you need a stacked visualization. I told you this was easy!

It is assumed that you understand the content in yesterday’s post. Those initial steps are not repeated here so that we can focus on the concept of stacked charts. What’s different from yesterday is that two columns are placed underneath Value.


Figure 2. You must drag both A Units Sold and B Units Sold to place them underneath Value.


Figure 3. Final stacked column chart.


Figure 4. You can change from a stacked column chart to a stacked bar chart by simply clicking the icon for a stacked bar chart.

With Power BI, it’s very easy to change your visualization by clicking on a different visualization. I caution you that you do need to pay attention. Not all visualizations are equal. Take a close look at the Y-axis when you take this data and select the line chart visualization.


Figure 5. Notice that the line chart visualization isn’t stacked and has a maximum Y-axis value of 20.


Figure 6. The stacked area chart has a maximum Y-axis value of 30.

Published Thursday, May 18, 2017 9:51 AM by John Paul Cook
Filed under:




Ravi Visvanathan said:

Thanks John.

I am doing the on line course from Microsoft on Power BI.

The instructors are great, but they move too fast, so you just see mouse blurs and then I am groping clicking on icons with crossed fingers and prayers.

Your tutorial was great and allowed me to learn at my own pace.

Learning by doing is best - thanks.

I was at the seafood place on the highway in Houston last year - Crab Shack I think.  

What a treat - enjoy and thanks a ton.

May 19, 2017 7:12 AM
Anonymous comments are disabled

About John Paul Cook

John Paul Cook is a database and Azure specialist in Houston. He previously worked as a Data Platform Solution Architect in Microsoft's Houston office. Prior to joining Microsoft, he was a SQL Server MVP. He is experienced in SQL Server and Oracle database application design, development, and implementation. He has spoken at many conferences including Microsoft TechEd and the SQL PASS Summit. He has worked in oil and gas, financial, manufacturing, and healthcare industries. John is also a Registered Nurse currently studying to be a psychiatric nurse practitioner. Contributing author to SQL Server MVP Deep Dives and SQL Server MVP Deep Dives Volume 2. Connect on LinkedIn

This Blog



Privacy Statement