Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
8 years ago
Solved

Add line break to column header in matrix visualisation

Hello All,

 

Please does anyone know whether it's possible yet to add a line break in a column header in the matrix visualisation?

 

Thanks,

 

MR

  • Anonymous,

     

    You may use the following calculated column.

    Column =
    SUBSTITUTE ( Table1[Column2], UNICHAR ( 32 ), UNICHAR ( 10 ) )

10 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    I suggest using emptycharacter.com which allows you to copy a character that resembles a space but Power BI lets you use as many as you want and will not cut it down to one like a typical space. In your values/column header in Power BI, input these before/after text then adjust column header width. By putting some of these characters before and after L52, then centering the column and adjusting the width, I was able to accomplish the below.

     

     

    • brentlightsey's avatar
      brentlightsey
      Icon for Advocate III rankAdvocate III

      What a great suggestion, thank you! I was not aware of https://emptycharacter.com/ but now will plan to use that - very helpful site!

       

      Also, I hope I never visit that site only to find my picture staring back at me! 😛

  • Hi,

    No You cannot add a line break to the column Headers

     

    Alternatively add a new record in the column used in Row Headers with value as Blank. Sorting it properly would make the Blank to appear below the Column Headers. This would give the look of a space after column header as any way you blank item in the Row Header will not have any data with it

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thanks Thejeswar, I was trying to do like this:

       

      change:

      December YTD

       

      to this:

      December

      YTD

       

      But I guess it is not possible. Sure wastes a lot of space!

       

      Thanks for your help.

       

      CM

      • brentlightsey's avatar
        brentlightsey
        Icon for Advocate III rankAdvocate III

        We wanted to show 
        CY FCST as 
        CY

        FCST

         

        Here's how we did it

        1. Open Microsoft Word
        2. Insert a symbol
        3. Find the "em space" unicode symbol (which is 32 decimal)
        4. Insert that into your Word doc
        5. Highlight that character and copy it to your clipboard
        6. Return to Power BI
        7. Typed in "CY", then CTRL+V to paste that unicode character, then "FCST"
        8. Power BI now respects the internal space enough to cause the words to wrap.
  • woody1957's avatar
    woody1957
    Regular Visitor

    try this:

     CombinedInfoColumn = Table.AddColumn(
            Source, 
            "Combined Info", 
            each Text.Combine({[Start Priority],Date.ToText([#"GMP/Construction Start Date"], "yyyy-MM-dd"), [Project Name]}, Character.FromNumber(10)), // Combines date and project name with a line break
            type text
        )
        in
     CombinedInfoColumn