How to Make a Stacked Bar Chart in Power BI with AI
Building a stacked bar chart in Power BI is a fantastic way to compare totals across different categories while also seeing the breakdown of each total. This article will walk you through the entire process, covering the traditional drag-and-drop method and showing you how Power BI’s AI features can help you create the exact same chart in seconds using plain English.
What is a Stacked Bar Chart?
Unlike a standard bar chart that shows a single value per category, a stacked bar chart divides each bar into segments, representing different subcategories. The total length of the bar shows the overall value for the main category, while the size of each segment shows its contribution to that total. It's the perfect tool for visualizing "part-to-whole" relationships across multiple groups.
When Should You Use a Stacked Bar Chart?
Stacked bar charts are incredibly versatile. They are most effective when you need to:
- Compare category totals and proportions. For example, comparing total sales across different regions while also seeing the breakdown of those sales by product category (laptops, desktops, accessories).
- Show composition over time. You might track quarterly website traffic, with each quarter's bar segmented by traffic source (Organic, Paid, Social Media, Direct). This lets you see if your total traffic is growing and if the mix of sources is changing.
- Visualize survey results. This type of chart can effectively show responses to a question (e.g., "Strongly Agree," "Agree," "Neutral") broken down by demographic groups like age or location.
- Analyze budget allocation. Visualize department budgets for the year, with each department's bar segmented by expense type (Salaries, Marketing, Operations).
Getting Your Data Ready for Power BI
The foundation of any great chart is clean, well-structured data. For a stacked bar chart, Power BI needs your data organized in a way it can understand. Before you import anything, make sure your dataset (whether it's in Excel, a database, or another source) contains at least three key columns:
- A main category: This will form the individual bars on your chart's axis. Think of these as the main groups you want to compare. (e.g., Region, Month, Sales Rep).
- A subcategory (or legend): This will determine the "stacks" within each bar (e.g., Product Line, Campaign Name, Customer Segment).
- A numeric value: This is the number you want to measure and compare (e.g., Sales Amount, Number of Clicks, Units Sold).
Here’s what a simple data table ready for Power BI might look like:
Once your data is structured, you can load it into Power BI by going to the "Home" ribbon, clicking "Get data," and selecting your source (like Excel Workbook or SQL Server).
Free PDF · the crash course
AI Agents for Marketing Crash Course
Learn how to deploy AI marketing agents across your go-to-market — the best tools, prompts, and workflows to turn your data into autonomous execution without writing code.
How to Create a Stacked Bar Chart in Power BI (The Manual Way)
The traditional method involves using the visualizations pane to build your chart piece by piece. This gives you precise control over every element.
Step 1: Select the Stacked Bar Chart Visual
In your Power BI report canvas, look at the Visualizations pane on the right-hand side. Find the icon for the "Stacked bar chart" – it looks like a horizontal bar divided into colored segments. Click it to add a blank chart object to your canvas.
Step 2: Drag and Drop Your Data Fields
With the blank chart selected, you’ll see several field wells in the Visualizations pane. This is where you tell Power BI how to construct the chart. Using our sample data from earlier, here’s what you’ll do:
- Y-axis: This field determines what each primary bar represents. Drag your main category, Region, from the Data pane into the Y-axis well. You will now see separate bars appear for North, South, East, and West.
- X-axis: This field determines the length of each bar. Drag your numeric value, Sales, into the X-axis well. The bars will now extend horizontally to represent the total sales for each region.
- Legend: This is the magic step for creating the stacks. Drag your subcategory, ProductCategory, into the Legend well. Immediately, each region bar will be segmented by colors representing the different product categories, and a legend will appear to explain the colors.
Just like that, you’ve built a stacked bar chart!
Step 3: Format Your Chart for Maximum Clarity
A functional chart is good, but a well-formatted one is even better. Select your chart, then click the "Format your visual" icon (the paintbrush) in the Visualizations pane. Consider these adjustments:
- Data labels: Turn these on to display the numeric value of each segment directly on the chart. This saves your audience from having to guess or estimate values based on the axis.
- Legend: You can adjust the position (Top Center is often cleaner than the default Right), text size, and visibility of the title.
- Bars: Change the colors to match your company's branding or to create better visual contrast between the segments. You can also adjust the spacing between the bars.
- Title: Change the default title (e.g., "Sum of Sales by Region and ProductCategory") to something more descriptive and human-readable, like "Total Sales by Region and Product Category."
Quick Tip: Right next to the "Stacked bar chart" icon in the Visualizations pane is the "100% stacked bar chart." With a single click, you can switch your visual to this type. Instead of showing actual values, it shows the percentage contribution of each segment, making it easier to compare the proportional mix across categories, regardless of their total size.
The AI Fast-Track: Creating a Stacked Bar Chart with Q&A
Building a chart manually is great for learning, but when you need answers fast, Power BI’s AI functionality is a game-changer. The Q&A (Questions & Answers) feature lets you create visuals simply by typing what you want in natural language.
Step 1: Activate the Q&A Visual
There are two quick ways to do this:
- Double-click on any empty area of your report canvas.
- Alternatively, select the Q&A icon from the Visualizations pane.
A Q&A box will appear, ready for your question.
Step 2: Ask Your Question in Plain English
Now, simply type a description of the chart you want to create. Power BI’s AI will interpret your request and generate the visual instantly. For the same chart we built manually, you would type:
show total sales by region as a stacked bar chart by product category
As you type, Power BI will underline the words it recognizes as fields or chart types, and the visual will update in real-time. Power BI understands that "sales" is your X-axis value, "region" is your Y-axis category, "product category" is your legend, and "stacked bar chart" is your desired visual type.
Here are a few more examples of prompts you could use:
line chart of signups by datetotal revenue by campaign source as a pie chartstacked bar of support tickets by status and owner
The flexibility of Q&A is its greatest strength. It lets you explore your data and test different visualizations without the friction of dragging and dropping fields repeatedly.
Step 3: Pin the Visual to Your Report
Once the Q&A feature has generated the chart you want, click the icon in the top-right corner of the visual that looks like a small pin. This converts the temporary Q&A result into a standard, permanent chart object on your report. From there, you can format it just like any other visual.
Free PDF · the crash course
AI Agents for Marketing Crash Course
Learn how to deploy AI marketing agents across your go-to-market — the best tools, prompts, and workflows to turn your data into autonomous execution without writing code.
Beyond Creation: Using AI for Deeper Insights
Power BI's AI capabilities don't stop at chart creation. Once you have your stacked bar chart, you can use AI to dig deeper into why the data looks the way it does.
Right-click on any specific segment of your chart - for example, the "Laptops" segment within the "East" region bar. From the context menu, select Analyze -> Explain the increase (or decrease, or distribution).
Power BI will then run statistical algorithms over your entire dataset to find what other factors might have contributed to that specific data point. It automatically generates a series of new charts and insights in a pop-up window, potentially showing you that the high laptop sales in the East were driven by a particular customer segment, happened during a specific month, or were handled by a top-performing sales rep. This is an incredibly powerful feature that turns a simple visual into a launchpad for deep analysis, saving you hours of manual exploration.
Final Thoughts
Mastering the stacked bar chart is a fundamental skill for anyone using Power BI, enabling you to tell compelling stories with your data. You can rely on the precise, manual method of dragging and dropping fields for full control, or you can leverage the speed of the AI-powered Q&A feature to get from question to insight in just a few seconds.
While Power BI’s AI features are a great step forward, we believe getting insights from your data should be as easy as having a conversation. For a truly seamless experience, we built Graphed . We connect directly to all your key data sources - from Google Analytics to Salesforce to Shopify - and let you build entire real-time dashboards just by asking questions. You don't have to think about fields, axes, or legends, just describe what you need to see, and a complete dashboard is ready in seconds.
Related Articles
Facebook Ads for Carpet Cleaners: The Complete 2026 Strategy Guide
Learn how to run Facebook ads for carpet cleaning businesses in 2026. Get proven strategies for targeting, creative formats, retargeting, and budget that actually convert.
Facebook Ads For Personal Trainers: The Complete 2026 Strategy Guide
Learn how to effectively use Facebook ads for personal trainers in 2026. This comprehensive guide covers targeting strategies, ad creative, budgeting, and optimization techniques to help you grow your training business.
Facebook Ads for HVAC Companies: The Complete 2026 Strategy Guide
Learn how to run high-converting Facebook ads for HVAC companies in 2026. This guide covers targeting, creative strategies, and proven campaigns that drive real leads.