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

Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now

Reply
kimchizal
Helper II
Helper II

Is there a way to vertically center text in a text box?

Simple scenario and question: I'm trying to vertically center some text in a text box. I've tried using the Title and also the General area, but can't get any text to appear vertically centered. Is there any wayt to do this?

19 REPLIES 19
YK-KZ
Frequent Visitor

Try  to use Segoe UI - font, you are welcome

Heroe.

Terp
Advocate III
Advocate III

...and for people who want to vertically align text in column headers for tables/matrix? All these 'just use shapes' and 'measures' overcomplicate the whole process and fall short of vertically aligning text in all applications, like simply borrowing the button from Excel and having both vertical and horizontal alignments of text. 🙂

 

(It's 2022 and still unable to veritcally align column headers, so was just passing through looking for a solution, aside from the shape box and measure workarounds). 

 

I'll completely redesign the header, but this is why vertical alignment would be nice...was going to break up the two columns to have 2021 top row, text underneath....but then 'Rank' and 'City'MSA/...' would still be "align: top"

 

Terp_0-1656954002235.png

 

jessylam365
New Member

use shape rather than text box

jessylam365_0-1648150121521.png

or what i did before is overlay 2 text box, one put in the center with the text.

jessylam365_1-1648150162554.png

 

The solution is as simple as jessylam365 says:

Use a Shape rather than a Textbox.

In the shape, you have the format option to add Text, which you can align both vertically and horizontally in the shape/box.

 

LoreGaggio_0-1650359807264.png

 

Thanks, this worked for me, although adding text was located in a slightly different location
Format shape > Shape > Style > Text

One of the tradeoffs with using a shape is that it doesn't let you insert values in-line with the rest of the text

That's a good point.

Dunners
Advocate II
Advocate II

Why is everything so difficult in PBI? Even the most basic requirements need a 'work around' 😠

 

 

Hi @Dunners be aware that since this answer was provided there were changes in the shapes that now allow a full custom of the text strings. 


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português



Thanks, but I still can't see how to vertically centre text in my version 2.100.1401.0 64-bit (December 2021)...?

kiwicam
Helper I
Helper I

Hi,

 

One work around is to create a measure with the text you want and then display it in a card.

e.g.

MyMeasureForText = "This is the text I want"

This_is_the_text_I_want.png

megavic
Advocate II
Advocate II

So strange that this is still not an option in Power BI; such a fundamental formatting option on a text box.

Available fonts and their formatting is also limited, again not sure why.

I've given kudos to @MFelix as this work around is the best option for vertical alignment that I've seen 🙂

Hi @megavic ,

 

Regarding the Fonts the explanation is pretty simple since PBI is to be used on web and mobile they install the "monst common fonts" you can add your own custom fonts and used them but you need to make sure that the others users also have it installed and you need to use a custom theme.

 

https://whatthefact.bi/power-bi/using-enterprise-or-custom-fonts-in-power-bi/

 

The other options about the text box, not really sure but with so many different options that have come out lately in terms of visualizations maybe they have left the text box a little behing in terms of options (just make a wild guess).

 

Thank you for your words.


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português



MFelix
Super User
Super User

Hi @kimchizal ,

 

When you are refering to vertically center the text is to center it on the text box or have it written vertically and centered?

 

First option you need to select the text and choose the option center, second option you need to write a letter in each row and then center it check below the image:

center.gif

Regards,

MFelix


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português



Vertically centered is having text that's centered around the horizontal middle of a text box. So in a 50px text box that's vertically aligned, the text should be around the 25 px mark when looking up/down the box.

 

The second option you mentioned isn't vertically centering the text - you're still horizontally centering it but just wrote a letter in every row.

 

Anonymous
Not applicable

Stole this from Excel (also in PowerPoint too).... you're basically looking for this button in 'Green' right?

 

 

image.png

 

I think @MFelix does that manually in the first part of his video because that button doesn't currently exist.

Yep, that's exactly what I'm looking for. I wish I could re-size my text box, but that's not an option so hence the question to try to vertically align text. If there's a way to hack around this, I'm all ears.

I ended up just manually entering in whitespace (new lines) and eyeballing the text to make it vertically centered

Hi @kimchizal ,

 

Sorry didn't realized you want to center it vertically as in Excel or PowerPoint.

One option is to create a measure or a table with the info with your text and then use a card visual instead of the text input.

 

As you can see below in the card visual information is always place in the middle of the visual.

center.gif

Regards,

MFelix

 

 


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português



Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

Check out the November 2024 Power BI update to learn about new features.

October NL Carousel

Fabric Community Update - October 2024

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