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
ansa_naz
Continued Contributor
Continued Contributor

With a legend, stacked bar chart data labels dont show, clustered bars become lines

Hi all

 

I want to display all the data labels on my stacked bar chart. If I remove the legend, then all the data labels display fine - some appear on the inside of the bars, and some are on the outside. I have Position set to Auto for the data labels. However, when I add the legend, the data labels where the bar is quite small dont appear any more. Anyone know how I can get around this?

 

See below stacked bar chart without legend:

 

Stacked No LegendStacked No Legend

 

And see below same bar chart but the only change I made is to add a legend:

 

Stacked With LegendStacked With Legend

 

I have tried using a Clustered Bar Chart instead, but that has a different issue - the bars become lines, and the lines then dont align with the axis values any more. See below clustered bar chart, exactly the same as the stacked bar chart, except it is a clustered bar chart, with no legend:

 

Clustered No LegendClustered No Legend

 

And the same clustered bar chart with a legend:

 

Clustered With LegendClustered With Legend

 

I need to have a legend as all the colours on the bars need to be different. In an ideal world, I would want the Stacked bar chart for its bars which are not lines and are also aligned with the axis values properly, and I would want the data labels on every bar per the Clustered Bar Chart. Is this possible?

 

Cheers

2 REPLIES 2
mdunnavant
New Member

The only way I've been able to mitigate this is by reducing the font as small as you can (8), turning 'Overflow text' on, and modifying the x-axis start and end.  Even after this though, there are still elements of a stacked bar that may not display their label.

 

Another option would be to remove the legend data then manually assign your data colors by turning 'Show All' on under 'Data Colors'.  However, this could be quite an effort in some cases.

ansa_naz
Continued Contributor
Continued Contributor

Thanks for that, font size and text overflow did bring show some more labels. Still dont understand why the Clustered Bar Chart with legend makes bars into lines though, otherwise I could have used that instead. Hopefully someone else has a solution to the Clustered Bar Chart, otherwise I think I will just have to put up with some data labels not being visible when a legend is used with a Stacked Bar Chart- again a bit weird why having a legend hides some data labels, and not using it shows them all

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.