The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
I'm working with a matrix visual where years are displayed as columns, and the user selects a range of years using a slider slicer. The goal is to have the matrix auto-adjust column widths so that the selected years always fill the entire visual width—whether it's 1 year or 10 years.
Here’s the issue:
If I enable Auto-size column width, it works fine for multiple years, but when only 1 or 2 years are selected, the matrix shrinks and leaves a lot of white space.
If I disable auto-size and manually set column widths, it doesn't adapt dynamically to the number of selected columns.
Has anyone found a workaround for this? Ideally, I’d like the matrix to stretch or compress column widths so that it always fills the visual area, regardless of how many columns are shown.
Would love to hear if anyone has tackled this with DAX tricks, conditional formatting, or layout hacks.
Solved! Go to Solution.
Hi @kushanNa ,
Thanks for the response. My concern was actually about having dynamic column widths in a matrix visual. Ideally, when a single year is selected, the column should expand to fill the entire table width. And when multiple years are selected, the columns should automatically adjust to fit within the available space. I found a workaround using DAX—by adding empty spaces to the values in the matrix, I was able to simulate dynamic sizing based on the selection.
HI @SreeSL12121
I tried to reproduce your issue, but I’m not seeing the same problem on my end. Could you please provide us with a sample PBIX file / Screenshots that demonstrates the issue you are facing?
Hi @kushanNa ,
Thanks for the response. My concern was actually about having dynamic column widths in a matrix visual. Ideally, when a single year is selected, the column should expand to fill the entire table width. And when multiple years are selected, the columns should automatically adjust to fit within the available space. I found a workaround using DAX—by adding empty spaces to the values in the matrix, I was able to simulate dynamic sizing based on the selection.
@SreeSL12121 That's Great !
Please share your DAX or the source where you found the workaround here, so others with a similar requirement can access the solution quickly . Thanks!
Hi @SreeSL12121 ,
Thanks for reaching out to the Microsoft fabric community forum.
I would also take a moment to thank @kushanNa , for actively participating in the community forum and for the solutions you’ve been sharing in the community forum. Your contributions make a real difference.
I hope the above details help you fix the issue. If you still have any questions or need more help, feel free to reach out. We’re always here to support you
Best Regards,
Community Support Team