Is there a way to add line breaks in a string of text in M (Power BI)?

Viewed 9966

I concatenated four columns using this code (to prevent null values to be linked together) in Power Query (Power BI Desktop):

= Text.Combine(List.Select(
{ [Col1], [Col2], [Col3], [Col4]    
}, each _<> "" and _ <> null),"; "))

I was wondering if there is a way to insert a line break instead of the "; " delimiter; that would make my visuals look neater!

Thanks in advance!

2 Answers

Try using "#(lf)" or "#(cr)" in place of "; "

= Table.AddColumn(#"Changed Type", "Custom", each Text.Combine(List.Select({ [Column1], [Column2], [Column3], [Column4]}, each _<> "" and _ <> null),"#(lf)"))

or

= Table.AddColumn(#"Changed Type", "Custom", each Text.Combine(List.Select({ [Column1], [Column2], [Column3], [Column4]}, each _<> "" and _ <> null),"#(cr)"))

Make sure to format the cells back in Excel as Word Wrap

Related