The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event: Join us in Stockholm, September 24-27, 2024.
Save €200 with code MSCUST on top of early bird pricing!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Hello everyone!
I need your help to solve a problem. I need to insert two concatenated fields, namely Description and Code, as rows in a Power BI matrix. I would like the Code to be properly aligned as if it were in a separate column from the Description, even though they are actually in the same column.
I've tried different codes, some work in a table, but when dragged into the matrix, they appear misaligned.
Do you have any ideas? Thank you very much.
As-is:
Solved! Go to Solution.
Hi @BeaBF,
First of all, you must use a monospace font (Courier New, for example).
Secondly, you must switch off the "Word wrap" option in the "Row headers" setting of the Matrix visual (see this solution - https://community.fabric.microsoft.com/t5/Desktop/Keep-spaces-in-column-fields-when-using-table-matr...).
Then everything works with a calculated column like this:
And the same in plain text:
LIV_5 =
VAR MinIdent = 1
VAR MaxLen = MAXX ( ALL ( data ), LEN ([Description] ))
VAR QtyExtraSpaces = MaxLen - LEN ( [Description] ) + MinIdent
RETURN [Description] & REPT (UNICHAR(32), QtyExtraSpaces ) & CONVERT ( [Code], STRING )
Best Regards,
Alexander
Hi @BeaBF,
First of all, you must use a monospace font (Courier New, for example).
Secondly, you must switch off the "Word wrap" option in the "Row headers" setting of the Matrix visual (see this solution - https://community.fabric.microsoft.com/t5/Desktop/Keep-spaces-in-column-fields-when-using-table-matr...).
Then everything works with a calculated column like this:
And the same in plain text:
LIV_5 =
VAR MinIdent = 1
VAR MaxLen = MAXX ( ALL ( data ), LEN ([Description] ))
VAR QtyExtraSpaces = MaxLen - LEN ( [Description] ) + MinIdent
RETURN [Description] & REPT (UNICHAR(32), QtyExtraSpaces ) & CONVERT ( [Code], STRING )
Best Regards,
Alexander
Hi @barritown!
First of all, thank you very much for your help. It's just what I had already implemented, with a slightly different formula but returning the same output.
I realized from your answer that the problem is the font, but I have a mandatory font to use.
Do you know if there is any resolution for this problem?
Hi @BeaBF,
Unfortunately, without a monospace font the problem seems to me unsolvable. I hoped to solve it with the help of the tabulation symbol instead of extra spaces but it doesn't work.
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the August 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
20 | |
18 | |
17 | |
14 | |
13 |
User | Count |
---|---|
36 | |
35 | |
21 | |
19 | |
18 |