Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
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.
I need like this below for above chart:
Please help
Regards,
Cruncher
Solved! Go to Solution.
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
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
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
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
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:
Here is the script I used:
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
User | Count |
---|---|
84 | |
79 | |
71 | |
48 | |
43 |
User | Count |
---|---|
111 | |
54 | |
50 | |
40 | |
40 |