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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Ncsbr
Frequent Visitor

Stacked bar With Percentage Label Keeping the Sizes

Hi,


I'm having an issue while trying to turn the labels of my stacked bar graph into percentage. The point is that the percent have to look up only for to the total of the column and not for the grand total as it does when we select "show value as" > "percentage of grand total"

 

I googled it, and tried to find some soluction on Microsoft Power BI forum but I couldn't find a soluction. The best that I found was creating the measure of the percent of total to put into the tooltip box so I can see the percentage in the lightbox that show informations of the bar when using the mouse. like this:


exemplo 1.png

The total of the month 2020/05 is 67 and 17 is 25% of it.
The measure %_Total in Dax:

 

 

%_Total = 
var Total = CALCULATE(DISTINCTCOUNT(Analise_Reativados[Id]),REMOVEFILTERS(Analise_Reativados[Compara_Meses (grupos)]))
var Clientes = DISTINCTCOUNT(Analise_Reativados[Id])
return Clientes/Total

 

 

Where Analise_Reativados[Compara_Meses (grupos)] is a group that aggregates through a list.

 

It should be like this in the end:

exemplo 2.png

But I don't know how to solve it.

Can someone help me?

Thanks!



1 ACCEPTED SOLUTION
v-zhangti
Community Support
Community Support

Hi, @Ncsbr 

 

After testing, if you want to use the column sum as the denominator, the size of the bar chart cannot be kept the same as the original one, because the sum is 100%. Only as shown in the figure.

vzhangti_0-1656934078331.png

 

If you want to keep the size of the bar chart constant, you can only use the total sum as the denominator.

vzhangti_1-1656934177775.png

 

Best Regards,

Community Support Team _Charlotte

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-zhangti
Community Support
Community Support

Hi, @Ncsbr 

 

After testing, if you want to use the column sum as the denominator, the size of the bar chart cannot be kept the same as the original one, because the sum is 100%. Only as shown in the figure.

vzhangti_0-1656934078331.png

 

If you want to keep the size of the bar chart constant, you can only use the total sum as the denominator.

vzhangti_1-1656934177775.png

 

Best Regards,

Community Support Team _Charlotte

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanks for the support @v-zhangti! Probably I will have to use Python or R code to work with this graph so ;)!


Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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