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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
CloudMonkey
Post Prodigy
Post Prodigy

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

1 ACCEPTED SOLUTION

@CloudMonkey,

 

You may use the following calculated column.

Column =
SUBSTITUTE ( Table1[Column2], UNICHAR ( 32 ), UNICHAR ( 10 ) )
Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

9 REPLIES 9
marksaba
Helper II
Helper II

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.

 

marksaba_0-1698244566932.png

 

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! 😛

Thejeswar
Resident Rockstar
Resident Rockstar

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

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

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.

Worked for me. Make sure you have Text wrap set to On for Column headers

 

Another option for typing these if you have keyboard with a number pad, you can hold down the Alt key and type 0160, which is a unicode "No-Break Space".

Rudz_0-1684351962795.png

 

It's smaller than an Em Space, so I type one, copy it, and paste in as many as I need to shift the text to the next line. If you don't have a number pad on your keyboard, copy it from Word. You can find it quickly on the "Special Characters" tab.

Rudz_4-1684353232110.png

 

If you are doing this right, the special spaces should appear in the column name after you rename it in the Visualizations pane like this:

Rudz_1-1684352735535.png

If you just used normal spaces, they are visible while editing:

Rudz_2-1684352778649.png

But after you hit enter, the whitespace is trimmed:

Rudz_3-1684352778650.png

The "special" space characters don't get trimmed, so that's what makes this trick work.

 

I also put a "normal" space after the "special" space characters with the Alt+0160 and it works better. I don't think you need it with the Em Space, but you can try it if the line wrapping isn't working for you.

This doesn't work... At all!

@CloudMonkey,

 

You may use the following calculated column.

Column =
SUBSTITUTE ( Table1[Column2], UNICHAR ( 32 ), UNICHAR ( 10 ) )
Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

@v-chuncz-msft wrote:

@CloudMonkey,

 

You may use the following calculated column.

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

Why is this accepted as a solution?

Helpful resources

Announcements
March Fabric Community Update

Fabric Community Update - March 2024

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

Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.