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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
SreeSL12121
Frequent Visitor

Power BI Matrix – How to dynamically adjust column width to fill full table space based on slicer se

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.

1 ACCEPTED 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.

View solution in original post

5 REPLIES 5
kushanNa
Super User
Super User

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?

 

kushanNa_2-1757298480071.png

 

kushanNa_1-1757298456177.png

 

 

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 ,

Glad you found an workaround, thank you for the update.

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  

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Kudoed Authors