In this blog, you will learn about how to create a stacked column chart in Power BI, a tool for displaying the cumulative frequency of different data series in a single column.
Introduction of Stacked column chart in PowerBI
A stacked column chart is a type of bar chart used in Power BI to display the relative contribution of different subcategories to a total category. Each column in the chart represents a total category, and within each column, different segments (or stacks) represent the subcategories that make up that total. This chart type is particularly useful for showing part-to-whole relationships and for visualizing the distribution of categories within a dataset.
Dataset description
In this tutorial, we’ll use a supermarket sales dataset that includes transaction details like invoice ID, branch, city, customer type, gender, product line, unit price, quantity, tax, total amount, sale date and time, payment mode, COGS, gross margin percentage, gross income, and purchase rating. This dataset offers comprehensive insights into sales activities, making it ideal for creating a stacked column chart in PowerBI.
You can access the dataset here.
Description: In this dataset, there following features/columns:
Invoice ID | Unique Identifier for each Invoice |
Branch | There are four branch Site |
City | City where transactions occurred |
Customer Type | Type of Customer – Member or Normal |
Gender | Gender – Male, Female |
Product Line | Type of Product |
Unit Price | Price of a Single Unit of Product |
Quantity | Total Quantity of Product Sell in a Single Purchase |
Tax 5% | 5% of Tax on Cost of Goods Sold |
Total | Total Amount of Items without Tax |
Date | Date of Sale |
Time | Time of Sale |
Payment | Mode of Payment |
COGS (Cost of Goods Sold) | Total Amount of Items with Tax |
Gross Margin Percentage | Total Profit in Percentage |
Gross Income | Total Profit |
Rating | Rating of the purchase in range of 1-10 |
Data Sample:
Procedure to Create Stacked column chart in PowerBI
Step1: Open your PowerBI Desktop on your Device
Step2: Click on Get Data button in Home Ribbon and select Text/CSV.
Step3: Open Prompt box will be open to select your text or csv file.
Step4: After selection of dataset, It will pop up a window for Load OR Transform Data. Click on Load to use data on PowerBI.
Step5: In the following picture, data has been loaded successfully.
Step6: Select Stacked Column Chart from Visualizations Section (Right Hand Side).
Step7: Here, we’ll put the following data (from supermarket_sales) in different fields:
X-axis | Gender |
Y-axis | Quantity (Sum of Quantity) |
Legend | Customer type |
After that you have to click on format your visual. Go to the General, click on turn on visual border and the shadow. In the Visual border make the rounded corner of 15 px.
Next Go to visual turn on the data labels.
What the Chart indicating:
The stacked column chart reveals that female customers purchased more products overall (2869 units) than male customers (2641 units). The chart distinguishes between normal and member users, with normal users purchasing 1377 units (female) and 1348 units (male), and member users buying 1492 units (female) and 1293 units (male).
Conclusion:
With stacked column charts, we can view our categorical and numeric data as columns and create a stack of other categorical or numeric data. We can get the details of each column by moving the cursor over the column as a tooltip.
If you like this blog, you can share it with your friends or colleague. You can connect with me on social media profiles like LinkedIn, Twitter, and Instagram.
🔔 Follow Me: LinkedIn| Youtube | Instagram | Twitter
👏 Like for this article and subscribe to our newsletter
📰 View more content on my DataSpoof website