How to Show Total in Stacked Bar Chart in Power BI
A stacked bar chart in Power BI is a fantastic way to compare parts of a whole across different categories. But often, while showing the breakdown is important, you also need to see the total sum of each bar. This article will walk you through a few simple but powerful methods to display total labels on your stacked bar charts, from a built-in toggle to a more advanced custom approach.
Why Power BI Doesn't Show Totals by Default
Before jumping into the solutions, it helps to understand why Power BI behaves this way. By default, a stacked bar chart is designed to emphasize the individual segments that make up the total. The length of the bar visually represents the total, a style Power BI chooses as a decluttered, clean start. Because data labels can have such an impact on readability for a chart like this, they and any accompanying options will always be turned off by default settings. By not adding totals by default, Power BI maintains this minimalistic, legible initial chart format and expects you to make a conscious choice as to what you decide to display. Luckily, adding them back in can often take just a few clicks if you know where to look. Other strategies for showing chart totals go a little more in-depth.
Let's imagine you have a stacked bar chart showing monthly sales broken down by product category. It's great for seeing that, for example, "Electronics" dominate in January, while also seeing the contribution from “Apparel” and “Home Goods.”
On their own, each column only gives details for the section they represent, which, when you are starting to analyze, is most times the perfect view, but can lead to questions like “which month had a high apparel performance while also creating more than $1,000,000 in total sales revenue?” Without a way to sum the entire chart, many analyses become incomplete.
Method 1: The One-Click Solution Using "Total labels"
For most simple charts, Power BI has a built-in feature that gets the job done quickly. This is the fastest way to get your totals on the chart without writing any code.
Step 1: Create a Stacked Bar or Column Chart
Start by building your visual. If you don't already have one, create a stacked column chart (or a stacked bar chart, the steps are identical).
- For the Y-axis (or X-axis for bar charts): Drag your main category. For example, 'Month' from your Date table.
- For the X-axis Legend: Drag the field that will create the "stacks." For our example, this would be 'Product Category'.
- For the X-axis (or Y-axis for bar charts): Drag your numerical value, such as 'Sales Amount'.
You should now see your stacked chart but still without totals for each column.
Step 2: Go to the "Format visual" Panel
Select your chart by clicking on it. In the "Visualizations" pane on the right-hand side of your canvas, click the paintbrush icon to open the "Format visual" settings.
Step 3: Enable Data Labels
Scroll down and find the "Data labels" option. Click the toggle to switch them "On." By default, you'll immediately see numbers appear on each segment of your bars. This adds some clarity but can also create clutter, especially having not yet adjusted a number's font and display settings in later steps. But most of all, your totals for both columns are, importantly, still not there.
Step 4: Turn on Total labels (and add a finishing touch)
With "Data labels" still on, expand the menu to reveal more options. Scroll to the bottom of the Data label settings and you will find an option for "Total labels." Toggle this to "On." Instantly, you’ll be able to see clearly-marked sums above or alongside each respective column. At a quick glance, and without breaking out a calculator, you can see not just a brand’s entire performance - but also take a guess at the strategy behind it all when individual totals are listed. Here you also might notice some options right beneath "Total Labels" for a title. Depending on whether a total label is necessary on your charts at the moment, with the “Total label title” option just clicking the toggle changes all of the sum totals to numbers following both "total," whatever column your selected metric is from, and "sum." Which may be useful if your chart will be displayed in certain report styles, dashboards, or in PowerPoint slides. Just this simple toggle provides a great starting point for analyzing stacked charts' totals while comparing individual entries at the same time and provides clear headings and categories to allow for more general questions or statements at first, before dialing in to make them more advanced. Once these totals are finally visible, this newly-cluttered look of these data totals gives us a look at what kind of styling the numbers and the entire graph may need more generally. By navigating to the Visual section you’ll have plenty of options with how data labels can be formatted.
When the Default "Total labels" Toggle Isn't Enough
The built-in button often works fine, but you will often run into situations where you may need total chart data delivered differently than the normal view. Creating a custom tool called a DAX measure can open up the solution to the specific need you are seeking an alternate visual answer on - and the needs vary from project to project:
- You want advanced formatting: Maybe you need to format the number in a specific way, like adding a currency symbol in the front ("$"), or different text contextually as either before or after a numeric or typed value (for example having data be represented like "Total: $500K" instead of just adding a note above all of your new columns), or to display as thousands rather than single digits everywhere like ($500 while others sit between, say, $10, $0, $150). Just changing the metric might change the design of more than expected.
- You need totals on a different chart: Some other, more customized visuals and chart types in Power BI don't even include a built-in “total labels” function like Power BI’s more central, foundational charts. In these cases, it becomes essential (instead of being an alternate method for less popular charts like clustered bar charts and other more nuanced styles) for most reports.
- The totals are not calculating how you would expect: On a rare occasion, a dataset could include certain features like multiple filter options which makes Power BI struggle to calculate total on a data set when a more nuanced filter needs to be applied, and needs clearer instructions on how to calculate what can only be defined in the unique language of a measure.
If you're in any of these situations, it's time to get a bit more hands-on using a touch of DAX (Data Analysis Expressions), Power BI's formula language. Don't worry, it's less intimidating than it looks when starting from the ground up on any project and especially if that’s your intro to it. We use DAX to just create a sum which simply defines new fields and variables. In our case, defining this will give Power BI instructions not just by a graph’s filter settings but an entirely new field that does only this math every single time we click, giving our other data that has other contextual value more of a break to process each time and instead just needs to fetch the numbers after they have been processed from only within your report and not outside. In many reports for large-scale companies it's just the process of pulling data from outside the Power BI dashboard as it tries to search online so finding workarounds to these wait times can have an immense business impact once implemented across departments.
Method 2: Using DAX and a Combo Chart for Total Customization
This method involves calculating the total using a DAX measure and then using a sneaky chart formatting trick to display them correctly. In this advanced workaround for data summing, an entirely new chart type from the stacked family is needed and the Line section is taken with the DAX measure. The trick here is in these formatting settings for making this just a stacked column chart, with all the formatting we need and even space to adjust things to be specific beyond other totals.
Step 1: Write a Simple DAX Measure for Your Total
This part takes the most initial thought but gives the best returns. Measures in Power BI let you create your own calculations no matter the size they seem they will be at. We will create two that specifically calculate a stack’s total value above any selected category, so that no matter the context they stay at the maximum of any stack.
- On the toolbar that runs across Power BI’s pages at the very top of each one, click “New Measure” - the small icon of a hand entering calculator numbers. It is located toward the mid-right under tools, and sometimes under different headings depending on your most recent used in-app software. This step is just a great start for practicing writing one when the time arises.
- When Power BI's top “ribbon” displays the new name of a measure you made by creating titles that fit best or by writing code into this DAX code you have can just name it what you already were after.
- For DAX there happens to be something specific about how to code where stacked bar charts can work the exact totals you need to analyze. In a normal measure they may even come out by adding, from our earlier example, things up to even make sense in the context of what you are building since now with an alternate solution there ends up being hundreds.
- Once you have copied and pasted the specific DAX logic for stacked charts into the field where DAX measure formulas always are - just press enter so not too much is loaded at once and be sure to check on your right-handed window of data.
Here's a generic and clear DAX pattern you can often easily adjust that we had shown above in our own example:
Total Sales Value = CALCULATE( SUM('YourTable'[Amount]), ALLEXCEPT('YourTable', 'YourTable'[AxisCategory]) )
Let's briefly break down why this works:
- SUM('YourTable'[Amount]): This is the simple part. It just sums up your value column. Amount becomes your Y axis, or whatever metric has the numeric values of a stack.
- CALCULATE(...): This is a DAX an extremely powerful “super power” feature where it is able to alter or modify filters after the expression is evaluated to get us exactly what they want in most unique circumstances. For our chart, it's how we define a SUM based on just its two elements and ignore other factors.
- ALLEXCEPT('YourTable'[Category/Axis]): This tells calculate to have
SUMapply to one field but ignore all others except your x-axis. In other words, the same logic applies to columns in a way giving us the power to create reports we only had access to from static, non-interactive Excel spreadsheets. Now our grand total lives in the formula and makes a brand-new calculation and we can put it in any places we need by searching for it by name.
Step 2: Change Your Visual
Switching your Chart will only change options you could not access before your DAX work. It won’t affect your visual's data nor settings so swapping around to combo charts or to others has little effect until you begin setting new chart filters.
Step 3: Add to Chart Values
Drag the DAX measure into its field like any other fields and now totals sit at the very top after all of the final edits.
Final Thoughts
You now have two effective methods for displaying totals in a Power BI stacked chart. For simple, quick visuals, the built-in "Total labels" function is easy and fast. Once your needs are more complex for different clients on bigger projects, combining a simple DAX measure with a simple chart such as a Line and stacked combo chart and editing its view with formatting can change not only the way you present data, but your whole analysis.
While getting things just right in DAX is still a useful and sometimes necessary function within even our company’s tech and for many reasons, we also know there are times where we need the best possible answers as efficiently as we can get for any role within the project for the time we can use. Here we built Graphed which can solve the issue of a manual deep dive altogether. Instead of learning and creating DAX every time you can get started even as your team is already building reports just using plain English like you normally speak. So having “what are my monthly mobile sales by their highest category” typed as a regular text message that creates full dashboards without needing IT is another example of a custom method to get specific report results at almost twice the speed.
Related Articles
How to Connect Facebook to Google Data Studio: The Complete Guide for 2026
Connecting Facebook Ads to Google Data Studio (now called Looker Studio) has become essential for digital marketers who want to create comprehensive, visually appealing reports that go beyond the basic analytics provided by Facebook's native Ads Manager. If you're struggling with fragmented reporting across multiple platforms or spending too much time manually exporting data, this guide will show you exactly how to streamline your Facebook advertising analytics.
Appsflyer vs Mixpanel: Complete 2026 Comparison Guide
The difference between AppsFlyer and Mixpanel isn't just about features—it's about understanding two fundamentally different approaches to data that can make or break your growth strategy. One tracks how users find you, the other reveals what they do once they arrive. Most companies need insights from both worlds, but knowing where to start can save you months of implementation headaches and thousands in wasted budget.
DashThis vs AgencyAnalytics: The Ultimate Comparison Guide for Marketing Agencies
When it comes to choosing the right marketing reporting platform, agencies often find themselves torn between two industry leaders: DashThis and AgencyAnalytics. Both platforms promise to streamline reporting, save time, and impress clients with stunning visualizations. But which one truly delivers on these promises?