Forum Discussion
How to lock width stacked bar chart visual
I made this visual for Google review scores using a stacked bar chart visual. There is no X axis so I'm unable to enter a minimum width. What's the best way to lock the column so it stays the same size regardless of what slicer selections have been made? Is it possible to achieve this without the X axis turned on?
Thankyou, MasonMA , Shahid12523 for your response.
Hi finley0726,
We appreciate your inquiry submitted through the Microsoft Fabric Community Forum.
Based on my understanding of the scenario, we followed the approach below, using a sample dataset, to ensure that the stacked bar chart maintains a constant width regardless of slicer selections:
- Create a helper table named SingleBar with a single row labelled All Reviews and use this as the Y-axis.
- Create measures such as Review Count, Review Percent and Review Label, and then build a stacked bar chart.
- In the Format pane, navigate to X-axis and set Minimum = 0 and Maximum = 1. Enable Data labels.
Locking the X-axis to the range 0–1 ensures that the bar always renders at full width. The segments resize proportionally when slicers are applied, but the overall bar length remains unchanged.
Please find attached a screenshot and a sample PBIX file that may help resolve the issue:
We hope the information provided helps to address your concern. Should you have any further queries, please feel free to contact the Microsoft Fabric Community.Thank you.
6 Replies
- MasonMASuper User
Hello finley0726
One of the solutions would be switching to '100% Stacked bar chart'. For 'Details' under 'Data Labels', instead of using the Default 'Percent of Total', use 'Custom' from a Measure or a Column. In below demo i picked 'Star' field. This way the bar is fixed on same size.
- v-pnaroju-msftCommunity Support
Thankyou, MasonMA , Shahid12523 for your response.
Hi finley0726,
We appreciate your inquiry submitted through the Microsoft Fabric Community Forum.
Based on my understanding of the scenario, we followed the approach below, using a sample dataset, to ensure that the stacked bar chart maintains a constant width regardless of slicer selections:
- Create a helper table named SingleBar with a single row labelled All Reviews and use this as the Y-axis.
- Create measures such as Review Count, Review Percent and Review Label, and then build a stacked bar chart.
- In the Format pane, navigate to X-axis and set Minimum = 0 and Maximum = 1. Enable Data labels.
Locking the X-axis to the range 0–1 ensures that the bar always renders at full width. The segments resize proportionally when slicers are applied, but the overall bar length remains unchanged.
Please find attached a screenshot and a sample PBIX file that may help resolve the issue:
We hope the information provided helps to address your concern. Should you have any further queries, please feel free to contact the Microsoft Fabric Community.Thank you.
- Shahid12523Community Champion
Fix bar width in Power BI:
Go to Format → X-axis
Set Start = 0, End = 1953 (total reviews)
Turn X-axis off again
Bar will now stay the same size regardless of slicers
- v-pnaroju-msftCommunity Support
Hi finley0726,
We would like to follow up and see whether the details we shared have resolved your problem.
If you need any more assistance, please feel free to connect with the Microsoft Fabric community.
Thank you. - v-pnaroju-msftCommunity Support
Hi finley0726,
We are following up to see if what we shared solved your issue. If you need more support, please reach out to the Microsoft Fabric community.
Thank you. - v-pnaroju-msftCommunity Support
Hi finley0726,
We wanted to see if the information we gave helped fix your problem. If you need more help, please feel free to contact the Microsoft Fabric community.
Thank you.