Forum Discussion
How to Expand Stacked Bars To fill Visual Pt2
I have a Clustered Stack column visual which has a number of columns in the middle of the visuals, see image
You will notice the columns are in the centre of the visual.
I would like help formatting the columns such that they spread across the entire visual similar to the following
Can someone please show me how to format the visual to accomplish expanding the columns across the page/visual. I think I might need to do some kind of padding, but not sure.
Hi caplogic ,
Here is the PBIX.
Let me also advise to you to take the learning paths because they can really help you start and get the main concepts.
https://www.microsoft.com/en-us/power-platform/products/power-bi/learning
https://learn.microsoft.com/en-us/training/browse/?products=power-bi
16 Replies
- MFelix
Super User
Hi caplogic ,
Here is the PBIX.
Let me also advise to you to take the learning paths because they can really help you start and get the main concepts.
https://www.microsoft.com/en-us/power-platform/products/power-bi/learning
https://learn.microsoft.com/en-us/training/browse/?products=power-bi
- pcoley
Super User
Step-by-step solution:
Click on your Clustered Column visual to select it.
Go to the Format your visual pane (paint roller icon).
Expand X-axis.
Look for these key settings and adjust them:
- Minimum category width — Increase this value (e.g., start with 50–150 pixels). This forces each column group to take up more space and helps spread them out.
- Inner padding — Decrease this percentage (try 10% → 5% → 0%). Lower inner padding makes the individual columns wider and reduces the gap between them.
- Maximum size (if available) — You can also increase this.
Pro tip: Try setting Minimum category width first — this is usually the most effective control when columns are squeezed in the center.
Quick Test Order (Recommended):
- Set Inner padding to 0% or 5%.
- Increase Minimum category width until the columns nicely fill the visual.
- Fine-tune as needed.
- caplogic
Helper II
- pcoley
Super User
This happens because Power BI squeezes the column groups into the center by default if you have multiple measures on the Y-axis and probably only a few (or none) categories on the X-axis.
please try whit the bigger value for the x-axis "Minimum category width"; and play with the width of the Column>Layout>"Space between series" and the position of the Legend (placed to the left or right side).
- pcoley
Super User
Another possible solution:
Switch the field between X-axis and Legend (or vice-versa): this will change how Power BI lays out the visual, and it can make the columns spread better in some cases — especially if you currently have a field with few unique values on the X-axis.
When it works well:
- If you move your main categorical field (e.g. Business Type) to X-axis, and put the measures (Gross, Net, etc.) in the Values field only (without Legend), you often get better spreading.
- Or vice versa: sometimes having the breakdown on Legend and a date/month on X-axis spreads things out more.
- caplogic
Helper II
I have provided a link to the PBIX
https://drive.google.com/file/d/1WKCLRJrXFmT9DMj_xgyQK-4ahuK0yGDt/view?usp=sharing
- MFelix
Super User
Hi caplogic ,
Since you are using several measures this automatically joins them has an histogram.
Adding to the great answers that pcoley gave you can also do the folllowing:
- Add a disconnect table with the name of the measures
- Add a new measure with the following code:
Chart Value = SWITCH(SELECTEDVALUE(KPIS[Sort]), 1, SUM(AcctHdlrAnalyisByPlyAndBdrRoot[TotalGrossPremium]), 2, SUM(AcctHdlrAnalyisByPlyAndBdrRoot[TotalNetPremium]), 3, SUM(AcctHdlrAnalyisByPlyAndBdrRoot[AverageGrossPremium]), 4, SUM(AcctHdlrAnalyisByPlyAndBdrRoot[AverageNetPremium]))Now use the Measure column on X-axis and the Chart Value measure on the values
If you allow me I suggest that you check the best practices for the usage of implicit measures vs explicit measures:
https://data-mozart.com/understanding-explicit-vs-implicit-measures-in-power-bi/
- pcoley
Super User
caplogic
I suggest changing a little bit your model:
1. In power query add an "unpivot" and a "change data type" steps :let Source = Sql.Database("XPS-18-LANDELLS", "latitude"), dbo_AcctHdlrAnalyisByPlyAndBdrRoot = Source {[Schema = "dbo", Item = "AcctHdlrAnalyisByPlyAndBdrRoot"]} [Data], #"Unpivoted Columns" = Table.UnpivotOtherColumns( dbo_AcctHdlrAnalyisByPlyAndBdrRoot, { "Account Handler", "BusinessType", "BinderRootStatus", "BinderType", "NumberOfPolicies", "BDXDate", "Coverholder" }, "Attribute", "Value" ), #"Changed Type" = Table.TransformColumnTypes(#"Unpivoted Columns", {{"Value", type number}}) in #"Changed Type"Create an explicit measur (best practices: do not use implicit fields directly where you want measures):
SumValues = sum(AcctHdlrAnalyisByPlyAndBdrRoot[Value])Finally in the Clustered Column Chart use the Categories (created in the UnPivot step in powerquery) as the x-axis field, and use SumValues Measure in the y-axis values:
- caplogic
Helper II
Hi all,
Thank you all for such great answers.
I'm about to review them now, but I just wanted to say thank you before I went through the responses.
Thank you