从单元格中提取前 3 个单词的 Dax 公式?
Dax formula to extract the first 3 words from a cell?
例如,我有一个标题为“根本原因”的专栏,其中有一个描述原因的句子。
是否可以提取前 3 个词?
(或者比分析句子更好)谢谢
您可以使用 M 语言转换。
这里有一个例子:
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("LcxBCsMwDATAryw+9xPJC3rozfigxKIyRBbYMqG/j0kDu7CwMDGGj5SOGULn6lx3DukVw1LNhRusMs7iArU2l7Xc738txwGhDrfxFQdtNvxPPMKb2mTzUP0hk2KbFdKQ0gU=",
BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type
nullable text) meta [Serialized.Text = true]) in type table [Sentence
= _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Sentence", type text}}),
#"Added Custom" = Table.AddColumn(#"Changed Type", "Custom", each Text.Combine(List.FirstN(Text.Split([Sentence]," "), 3), " " )) in
#"Added Custom"
例如,我有一个标题为“根本原因”的专栏,其中有一个描述原因的句子。
是否可以提取前 3 个词?
(或者比分析句子更好)谢谢
您可以使用 M 语言转换。
let Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("LcxBCsMwDATAryw+9xPJC3rozfigxKIyRBbYMqG/j0kDu7CwMDGGj5SOGULn6lx3DukVw1LNhRusMs7iArU2l7Xc738txwGhDrfxFQdtNvxPPMKb2mTzUP0hk2KbFdKQ0gU=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Sentence = _t]), #"Changed Type" = Table.TransformColumnTypes(Source,{{"Sentence", type text}}), #"Added Custom" = Table.AddColumn(#"Changed Type", "Custom", each Text.Combine(List.FirstN(Text.Split([Sentence]," "), 3), " " )) in #"Added Custom"