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?
...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"
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.
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.
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.
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.
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:
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.
Stole this from Excel (also in PowerPoint too).... you're basically looking for this button in 'Green' right?
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.
Take a look at the September 2023 Power BI update to learn more.
Join Microsoft Reactor and learn from developers.
Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!