Forum Discussion
Making font wrap work correctly for matrix column headers?
- 3 years ago
Hey andyor ,
as you said by default you have to do that manually.
However there are a few hacks. I think the best approach is the following:
The ultimate hack to set column widths in a matrix | Esbrina (esbrina-ba.com)
If you need any help please let me know.
If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍
Best regards
Denis
Blog: WhatTheFact.bi
Follow me: twitter.com/DenSelimovic
Hey andyor ,
as you said by default you have to do that manually.
However there are a few hacks. I think the best approach is the following:
The ultimate hack to set column widths in a matrix | Esbrina (esbrina-ba.com)
If you need any help please let me know.
If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍
Best regards
Denis
Blog: WhatTheFact.bi
Follow me: twitter.com/DenSelimovic
Hi selimovd this link seems great in theory but it doesn't explain how to do the steps it shows.
I tried adding the below as a new column but there isn't a column width table or column in my dataset, so that can't work. The solution also talks about calculation group column, alternate values etc .
When I download the pbix file there are 2 extra tables - Column Width and Spacing. They both have an 'Ordinal' attached and there's no mention of this in the solution. The other table is 'Sales', and there are no new columns or measures here either.
Where are we entering code like the below?
5 (format string expression) =
VAR currentValue =
SELECTEDMEASURE ()
VAR currentLength =
LEN ( CONVERT ( currentValue, STRING ) )
VAR selectedLength =
CONVERT (
SELECTEDVALUE ( 'Column Width'[Column Width], currentLength ),
INTEGER
)
VAR extraSpaces =
IF ( selectedLength > currentLength, selectedLength - currentLength, 0 )
VAR prefix =
REPT ( UNICHAR ( 0160 ), extraSpaces )
RETURN
"""" & prefix & """"
& SELECTEDMEASUREFORMATSTRING ()