Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
1 year ago
Solved

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.

  • Anonymous's avatar
    Anonymous
    1 year ago

    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.

5 Replies

  • HI Anonymous 

     

    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?

     

     

     

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      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.

      • v-menakakota's avatar
        v-menakakota
        Icon for Community Support rankCommunity Support

        Hi Anonymous ,

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

    • v-menakakota's avatar
      v-menakakota
      Icon for Community Support rankCommunity Support

      Hi Anonymous , 

      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