Forum Discussion

jthom91's avatar
jthom91
Regular Visitor
3 months ago
Solved

Matrix Column Widths

Where to start on this...

 

Use case: 

 

I have a matrix visual displaying monthly values for p12m - I want the months to *somewhat* align with a line chart that is above the matrix. Hardly a groundbreaking formatting choice. 

 

My go to option for the last year or so has been to drop a measure  =rept('x',8)  in to the values - swap values to rows, toggle autosize off, then remove the measure - bosh - equal size columns to your width of choice. Quick, easy, clean. 

 

A recent update - I'm not sure which one - has bricked the above workaround - despite autosize being off, the columns will change width once the column width measure is removed. 

 

The two options remaining:

'Fit to Content' - junk 
'Grow to fit' - this is what I am after, in practice, but the columns scale according to their contents, not evenly - so you have a matrix as wide as the container, but with uneven, distracting column sizes

 

Fix - grow to fit, then manual dragging of column widths - manual labour, tedious, time consuming - no thanks 

 

Fit to Content: 

 

Grow to Fit: 

 

If I'm missing something painfully obvious please put me out of my misery. Thanks! 

 

5 Replies

  • Hi jthom91  -you can keep the spacer measure, just hide it instead of removing it.

    eg:, Column Spacer = REPT(" ", 12)

     

    Add Column Spacer to your Values >> Turn ON >> Values - Show on rows and Now you’ll see an extra row that’s the spacer

     

     

     

     

    Hope this heps.

    • jthom91's avatar
      jthom91
      Regular Visitor

      This didn't help. 

       

      column width = rept("x",9)

       

      column width = rept(" ",9)

       

  • v-karpurapud's avatar
    v-karpurapud
    Community Support

    Hi jthom91 
    Thanks for sharing the screenshots and additional testing .

    This appears to be related to a recent change in the Matrix visual rendering behavior, where column widths can be recalculated even when Auto-size width is turned off. There are similar community reports documenting the same behavior:

    Matrix Table resizing columns with Autosize column... - Microsoft Fabric Community
    Re: Matrix visual column width rendering regressio... - Microsoft Fabric Community

    In the current behavior, removing the helper/spacer measure causes the Matrix visual to re-render and recompute column widths, so the earlier workaround (adding a REPT measure, sizing, then removing it) no longer persists after the measure is deleted.
    As a workaround keep a spacer measure permanently in the visual, for example:

    Column Spacer = REPT(UNICHAR(8203), 12)

    Add this measure to the Values section, enable Show values on rows, turn Auto-size width = Off, then manually resize the columns once. After that, keep the measure in place and hide the spacer row by using matching font/background colors, turning off subtotals, and reducing row padding.

    Unfortunately, there is still no native option to enforce equal column widths in Matrix visuals, and the newer “Grow to fit” behavior distributes space based on content size rather than evenly across columns.
     
    There are existing Ideas related to fixed/equal column widths and retaining manual sizing. I recommend upvoting them, as this helps the product team prioritize improvements:
    Enable setting a fix width of each column in a mat... - Microsoft Fabric Community
    Fixed Column Width for Columns in PBI - Microsoft Fabric Community
    Enable setting a fix width of each column in a mat... - Microsoft Fabric Community


    If you have any further questions, feel free to reach out and we'll be glad to assist.
     

    Regards,

    Microsoft Fabric Community Support Team.
     




  • v-karpurapud's avatar
    v-karpurapud
    Community Support

    Hi jthom91 

    I wanted to check if you’ve had a chance to review the information provided. If you have any further questions, please let us know. Has your issue been resolved? If not, please share more details so we can assist you further.

    Thank You.

  • v-karpurapud's avatar
    v-karpurapud
    Community Support

    Hi jthom91 

    Just checking in as we haven't received a response to our previous message. Were you able to review the information above? Let us know if you have any additional questions.

    Thank You.