Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
cruncher
Helper II
Helper II

How to get total in same 100 % stacked Bar chart

Hi Folks,

 

How I can get the each customer total for each customer in same 100 % Stack bar chart chart just like we have total labels in stacked bar chart.  Either after the Customer name or after the bar chart.

 

cruncher_0-1748001579498.png

I need like this below for above chart:

 

cruncher_1-1748001708363.png

 

Please help

 

 

Regards,

Cruncher

1 ACCEPTED SOLUTION
kushanNa
Solution Sage
Solution Sage

7 REPLIES 7
kushanNa
Solution Sage
Solution Sage

Hi @cruncher 

 

I think i have a solution for this using python power bi visual 

Media1 (2).gifMedia2.gif

 

 

https://community.fabric.microsoft.com/t5/Power-BI-Community-Blog/Custom-Visualization-of-a-100-Stac... 

v-priyankata
Community Support
Community Support

Hi @cruncher 
Thank you for using Microsoft Community Forum.

Below is the sample Power BI report like how to show total sales per customer in a 100% stacked bar chart, using two effective methods:

The report contains two pages:

 

Sample1 – Customer Name with Total Label

A calculated column displays the total sales next to each customer name on the Y-axis.

This helps show totals even when using 100% stacked bar charts that don’t support them natively.

 

Sample– Tooltip Showing Total Sales

A DAX measure calculates total sales by customer.

This measure is added to the tooltip to give exact values on hover without altering the chart layout.

 

The attached .pbix file includes both pages with sample data and DAX logic implemented.

If this information is helpful, please “Accept as solution” and give a "kudos" to assist other community members in resolving similar issues more efficiently.
Thank you.

 

Thanks @v-priyankata Sample 1 can be used if there is no workaround available to show total beside the bars. Can we show totals in Bold color to differentiate from customer name

kushanNa
Solution Sage
Solution Sage

Hi @cruncher 

 

A workaround I can think for this is overlaying two visuals and get the result you need , 

 

1. create a cluster bar chart with total 

2. show data labels in outside end Position

3. create a measure for max and add it in to the max of x axis , so the total label will stay in the left side after customer name

 

MAX = [Total] * 10000

 

kushanNa_0-1748252457909.png

4. remove the background , x axis values label and a align it top/behind of the 100% stack bar chart visual 

 

it should looks like the this , so even when you do dynamic selections it will not change the position 

 

kushanNa_1-1748252633992.png

kushanNa_2-1748252678208.png

 

 

Thanks for the workaround @kushanNa . It works when there is no vertical scrollbar. In my data, list can be large based on user selection and when scroll bar appears then two visuals doesn't move synchronously

SamWiseOwl
Super User
Super User

Hi @cruncher 

 

I don't think there is a native way to do this.

What you could do is create a measure and set the Detail or Value to Custom.

Then pull in a measure that returns the total:

SamWiseOwl_0-1748004141739.png

 

Here is the script I used:

Region Total =
If(
    SELECTEDVALUE(Environment[EnvironmentName]) = "Land"
    --Choose which section to put the text next to, I used the middle
     ,CALCULATE(
    sum(Purchase[Quantity]) --Your original calculation
    ,All(Environment) --remove the filter caused by the lengend
    )
    ,BLANK() --optionally hide this total on the other sections
    )

If you are happy with this answer please mark as a solution for others to find !

Kudos are always appreciated! Check out our free Power BI video courses.

Thanks for looking at it Sam.

 

In my case legend is dynamic. It could be possible middle value doesn't exists or value is negligible. Therefore I can't put in middle of bars. It should be either left or right of bar.

 

Here is my sample file pbix if there any workaround you can provide

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.