THE SQL Server Blog Spot on the Web

Welcome to SQLblog.com - 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.

image

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.

image

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

image

Figure 3. Final stacked column chart.

image

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.

image

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

image

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:

Attachment(s): PowerBI20170518.zip

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

 

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

Leave a Comment

(required) 
(required) 
Submit

About John Paul Cook

John Paul Cook is a database and Azure specialist who works 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 who graduated from Vanderbilt University with a Master of Science in Nursing Informatics and is an active member of the Sigma Theta Tau nursing honor society. He volunteers as a nurse at a clinic that treats low income and uninsured patients. Contributing author to SQL Server MVP Deep Dives and SQL Server MVP Deep Dives Volume 2. Connect on LinkedIn

This Blog

Syndication

Privacy Statement