Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago

How to fix column widths in a matrix where column headers change with each refresh

Hello,

Can someone please help me with a solution? I have a Power BI matrix with several column fields (headers) which change whenever the data is refreshed. The auto-size option is already turned off and text wrap is turned on. 

Or if there's some way we can have a bubble matrix in Power BI where we can have some spacing between the column bubbles?

Thanks in advance

rowsandcolumns 

10 Replies

  • Hi Anonymous ,

     

     For the fix of  the width of the column headers, In properties pannel> column headers>you have to off the Text wrap option, and off the turn off auto size width option., will fix the issue.

    Did I answer your question? Mark my post as a solution! Appreciate your Kudos!! 

    Regards,

    Preeti Yadav

     

    • Preeti_Yadav's avatar
      Preeti_Yadav
      Icon for Resolver I rankResolver I

      ++

      The matrix formatting in a bubble format is not possible for now as theres no such option is available for cell formatting.

       

      Regards,

      Preeti Yadav

    • Anonymous's avatar
      Anonymous
      Not applicable

      Preeti_Yadav 

      I tried turning off both the auto-size and text wrap, however, whenever the column headers change, i.e, replaced by a new column header name/text, it doesn't work. This is because the headers are also dynamic in nature. 

      Is there any way we can completely fix the column width so that it never changes irrespective of any change in the data?

      • Anonymous's avatar
        Anonymous
        Not applicable

        Hi Anonymous ,

         

        Power BI will automaticlly set auto-size width for new column. So currently, the best workaround should be turn off Auto-size with and Text wrap option in format mentioned above and then drag the width of column header manually.

        Your demand is a good idea, while it is not supported to implement in Power BI currently.
        You can vote up this idea for this function: Auto Fitting Column Width

        Or you can submit a new idea to improve the Power BI.
        It is a place for customers provide feedback about Microsoft Office products . What’s more, if a feedback is high voted there by other customers, it will be promising that Microsoft Product Team will take it into consideration when designing the next version in the future.

         

        Best Regards,
        Rico Zhou

         

        If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • The solution to maintain constant column widths in Power BI Table and Matrix visuals is to use the UniChar() function, Len() function and the Repeat function Rept().  You can thus build very specific widths that wont change.
    Here is a complex example, checking different columns.

    var Char = UNICHAR(8194)
    var LENGTH = len('Table'[ReportingPeriod])
    var PPSpaces = 15
    var CYSpaces = 5

    Return
    -- Check if Reporting Period is 4 characters
        IF (
        Len('Table'[ReportingPeriod]) <> 4,
    -- Create a 15 space string for Plan Period
        Rept(Char,1) & 'Table'[ReportingPeriod]
     -- Create a 15 space string for Calendar Year
        ,Rept (Char,5) & 'Table'[ReportingPeriod] & Rept(Char,CYSpaces)
         )
    • Anonymous's avatar
      Anonymous
      Not applicable

      Hello Preeti_Yadav ,

      As mentioned, I have a matrix with these headers 


      And whenever I refresh the data, the number of headers and the values change, due to which the width of the headers also change (screenshot below) 


      Would it be possible to fix the width of the column headers where it doesn't change irrespective of the change in header name or number of headers?

      Moreover, would it be possible to set the matrix formatting in a bubble format instead of rectangular cell blocks (screenshot below)