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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
Gautam_Yadav
Regular Visitor

Vertical Alignment of Row Headers in Matrix

Hi Everyone
I have attached a photo below

I want the Category [Row Header] To be Vertically Alligned At Centre 
I tried the below Calculated Column 

Padded Row Header = REPT(UNICHAR(10), 195) & 'CategorySource'[Category]


It dosent work , are there any work arounds?

Untitled.png

 

1 ACCEPTED SOLUTION

Got it thanks for the reply.

As of now Since there are no constant Visual Changes I just added a Text Box Above Them and Aligned as needed.

View solution in original post

12 REPLIES 12
danextian
Super User
Super User

Hi @Gautam_Yadav 

This would be a very difficult thing to do even with dynamic lenght of left and right pad characters as each character in the text string can have a varying width (1 and i very narrow while W is very wide).

Centered Subcategory = 
VAR _PadChar =UNICHAR(8199) // choose any character you want, e.g. " ", "-", "*", etc.
VAR _Sub = [Subcategory]
VAR _MaxLen =
    MAXX ( ALL ( 'Table' ), LEN ( 'Table'[Subcategory] ) )
VAR _CurLen = LEN ( _Sub )
VAR _TotalPad = _MaxLen - _CurLen
VAR _LeftPad = INT ( _TotalPad / 2 )
VAR _RightPad = _TotalPad - _LeftPad
VAR _result = 
    REPT ( _PadChar, _LeftPad ) & _Sub & REPT ( _PadChar, _RightPad )
return
_result

Here's a sample calculated column. You can see that it doesn't visually perfectly align the texts

danextian_0-1756467933444.png

 

 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

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


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

Got it thanks for the reply.

As of now Since there are no constant Visual Changes I just added a Text Box Above Them and Aligned as needed.

Hi @Gautam_Yadav ,

 

Thank you for your response. Can you confirm whether adding the text box resolved your issue, or if the workaround provided by the @danextian  was the solution? Your feedback will enable us to close the loop effectively and offer clear guidance to others who encounter similar situations.

 

Thank you,

Tejaswi.

The text box resolved my Issue.

Hi @Gautam_Yadav ,

 

I'm glad you found a solution and resloved  the query. Thank you very much for sharing here.

If you have further queries please reach out.

 

Thankyou for connecting with Microsoft Community Forum.

GeraldGEmerick
Responsive Resident
Responsive Resident

@Gautam_Yadav Perhaps: 

Padded Row Header = REPT(UNICHAR(10) & UNICHAR(13), 195) & 'CategorySource'[Category]

Hi @GeraldGEmerick  Thanks for the reply.
I tried your solution the Row Headers are Still at Top Left and not bulging. 

@Gautam_Yadav Perhaps try increasing your Grid padding. I'm still not clear on how your matrix is configured to understand your setup. Can you share additional details? Like what columns are in which fields, etc.

GeraldGEmerick_0-1756401664977.png

 

Gautam_Yadav_0-1756405939168.pngGautam_Yadav_1-1756405948267.png

Sharing Above my fields
I already have enough padding Sharing below settigns

Gautam_Yadav_2-1756406031914.png

 




 

@Gautam_Yadav In looking at this some more, doesn't look possible. The reason is that it looks like perhaps you are using the Compact layout and you have turned off row banding for Row Headers. If you turn that back on, you will see that the value only appears in the first row. Therefore, even if you managed to put verticle whitespace around that value, all it would do is expand the height of that one row and push all the other rows down which is not what you want to achieve. 

It would be greatly appreciated if you could share a PBI file where you have implemented this. I will attempt to replicate the process on my end.

Gautam_Yadav_0-1756434747912.pngI am using the Default,Outline.

 

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

Top Solution Authors