在 PowerBI 中用换行符连接文本 [英] Concatenate text with newlines in PowerBI
问题描述
如果我在表格中有一个列,其中每个单元格都包含文本,我如何将它们作为输出推入例如一张卡片并用新行分隔单元格?
我一直在使用 CONCATATENATEX
函数,它接受一个分隔符参数;但是标准的换行符 ('\n'
) 不起作用.
可以使用 UNICHAR(number)
函数将 Unicode 字符传递给 CONCATATENATEX
函数.
number
参数对应于十进制 UTF-16 或 UTF-32 编码(如图所示
在Measure代码的最后一行,标记为黄色,您可以看到使用UNICHAR(10)
作为换行符.
如果在切片器对象中没有选择任何内容(即默认情况下选择所有内容 - 不使用过滤器),则卡片中将显示显示其他文本".
If I have a column in a table where each cell contains text, how can I push them as output into e.g. a card and separate the cells with a new line?
I have been using the CONCATENATEX
function, which takes a delimiter argument; however the standard new line character ('\n'
) doesn't work.
It is possible to pass Unicode characters to the CONCATENATEX
function, using the UNICHAR(number)
function.
The number
parameter corresponds what looks to be the decimal UTF-16 or UTF-32 encodings (as shown here).
This means a new line is given by UNICHAR(10)
.
A final solution might then be: CONCATENATEX(TableName, TableName[TextColumn], UNICHAR(10))
Here is a screenshot that shows:
- the input table in Excel (top left)
- The table once imported into Power BI Desktop (top right)
- The Measure 'Description' and the output within a Card object (bottom)
In the last line of the Measure code, marked yellow, you can see the use of UNICHAR(10)
as a new line separator.
If nothing were to be selected in the Slicer object (i.e. everything is selected by default - no filter is used), then "Show other text" would be displayed in the Card.
这篇关于在 PowerBI 中用换行符连接文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!