有没有办法在 M (Power BI) 中的文本字符串中添加换行符?
Is there a way to add line breaks in a string of text in M (Power BI)?
我在 Power Query (Power BI Desktop) 中使用此代码连接了四列(以防止空值链接在一起):
= Text.Combine(List.Select(
{ [Col1], [Col2], [Col3], [Col4]
}, each _<> "" and _ <> null),"; "))
我想知道是否有办法插入换行符而不是“;”定界符;这会让我的视觉效果看起来更整洁!
提前致谢!
您可以在没有可选的 lineSeparator 的情况下使用 Lines.ToText (https://docs.microsoft.com/en-us/powerquery-m/lines-totext)。
尝试使用“#(lf)”或“#(cr)”代替“;”
= Table.AddColumn(#"Changed Type", "Custom", each Text.Combine(List.Select({ [Column1], [Column2], [Column3], [Column4]}, each _<> "" and _ <> null),"#(lf)"))
或
= Table.AddColumn(#"Changed Type", "Custom", each Text.Combine(List.Select({ [Column1], [Column2], [Column3], [Column4]}, each _<> "" and _ <> null),"#(cr)"))
确保将 Excel 中的单元格格式化为自动换行
我在 Power Query (Power BI Desktop) 中使用此代码连接了四列(以防止空值链接在一起):
= Text.Combine(List.Select(
{ [Col1], [Col2], [Col3], [Col4]
}, each _<> "" and _ <> null),"; "))
我想知道是否有办法插入换行符而不是“;”定界符;这会让我的视觉效果看起来更整洁!
提前致谢!
您可以在没有可选的 lineSeparator 的情况下使用 Lines.ToText (https://docs.microsoft.com/en-us/powerquery-m/lines-totext)。
尝试使用“#(lf)”或“#(cr)”代替“;”
= Table.AddColumn(#"Changed Type", "Custom", each Text.Combine(List.Select({ [Column1], [Column2], [Column3], [Column4]}, each _<> "" and _ <> null),"#(lf)"))
或
= Table.AddColumn(#"Changed Type", "Custom", each Text.Combine(List.Select({ [Column1], [Column2], [Column3], [Column4]}, each _<> "" and _ <> null),"#(cr)"))
确保将 Excel 中的单元格格式化为自动换行