March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hello everybody ,
how can i make a line break without touching the size of the column in a matrix, knowing that i only have values in column ?
like \n
everyone can help me ?
thank you
Solved! Go to Solution.
Hi , @randomUser21
Thanks for your quick response! According to your description, you want to add \n in the column headers.
I test it in my side , the \n in Power Query Editor will not apply to Desktop.And in my workexperience , i have found no way to realize it in Power Query Editor now.
So you can just only use the UNICHAR to add the \n in Power BI Desktop.
But also you can not put the measure as the column headers.
For your need , we can add a blank query in Power Query Editor:
And then we can put this M code in "Advanced Editor":
let
Source = Table.ColumnNames(Table),
#"Converted to Table" = Table.FromList(Source, Splitter.SplitByNothing(), null, null, ExtraValues.Error)
in
#"Converted to Table"
Then we can get the column headers we need amd we need to apply the data to Desktop:
Then we can add a caluclated column in the table.
Column = LEFT([Column1],7) & UNICHAR(10) & MID([Column1] ,8, LEN([Column1])-7)
Then we can use this column as the headers and create a measure to return the according value.
Measure = IF(MAX('Query1'[Column1] )= "First description" , SUM('Table'[First description]) , SUM('Table'[Second description]))
Thank you for your time and sharing, and thank you for your support and understanding of PowerBI!
Best Regards,
Aniya Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
hello @v-yueyunzh-msft ,
thank you for your message
sorry I expressed myself badly, I wanted this on the header of the column. in your example it was to make First \n description without modifying the length of the column
Hi , @randomUser21
Thanks for your quick response! According to your description, you want to add \n in the column headers.
I test it in my side , the \n in Power Query Editor will not apply to Desktop.And in my workexperience , i have found no way to realize it in Power Query Editor now.
So you can just only use the UNICHAR to add the \n in Power BI Desktop.
But also you can not put the measure as the column headers.
For your need , we can add a blank query in Power Query Editor:
And then we can put this M code in "Advanced Editor":
let
Source = Table.ColumnNames(Table),
#"Converted to Table" = Table.FromList(Source, Splitter.SplitByNothing(), null, null, ExtraValues.Error)
in
#"Converted to Table"
Then we can get the column headers we need amd we need to apply the data to Desktop:
Then we can add a caluclated column in the table.
Column = LEFT([Column1],7) & UNICHAR(10) & MID([Column1] ,8, LEN([Column1])-7)
Then we can use this column as the headers and create a measure to return the according value.
Measure = IF(MAX('Query1'[Column1] )= "First description" , SUM('Table'[First description]) , SUM('Table'[Second description]))
Thank you for your time and sharing, and thank you for your support and understanding of PowerBI!
Best Regards,
Aniya Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
thank you
Hi , @randomUser21
According to your description, you want to add a \n in the value in Matrix visual.
First for the value in Matrix , we can first check the "Text wrap" in the format pane to open the auto-textwrap for the value.
And if this can not meet your need , we can also use the DAX code( UNICHAR(10) ) to add a "\n" for the value.
Measure = LEFT(MAX('Table'[Description]),20) & UNICHAR(10) & MID(MAX('Table'[Description]) ,21, LEN(MAX('Table'[Description]))-20)
The result is as follows:
For this , you can also refer to:
How to add line breaks in a string of text in DAX measure - Power BI Docs [619f-c5a9-58d-825e]
And if i misunderstand your need , you can also share me the sample data and your end result like a tabke format to me so that i can help you better!
Best Regards,
Aniya Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
User | Count |
---|---|
36 | |
27 | |
19 | |
11 | |
8 |
User | Count |
---|---|
55 | |
43 | |
25 | |
13 | |
12 |