大家好,如何计算仅包含文本值的 powerquery 表中的行数。
我希望我的表格采用这种格式。
邮件 | 听 | 鲍比 | 总计 |
---|---|---|---|
B | 1 | C | 2 |
B | 0 | 3 | 1 |
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WclJQ0lEyBBHOCkqxOlABAxBhDBSIBQA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Mail " = _t, #"listern " = _t, #"Boby " = _t]),
#"Added Custom" = Table.AddColumn(Source, "Custom", each
let a = Record.ToList(_),
b = List.Transform(a, each try Number.From(_) otherwise "Text" ),
c = List.Select(b, each _ = "Text" ),
d = List.Count(c)
in d, Int64.Type)
in
#"Added Custom"
PowerQuery 中的另一种方式
#"Added Custom" = Table.AddColumn("#PriorStepNameHere", "TOTAL", each List.Sum(List.Transform(Record.ToList(_), each try Number.From(_)-Number.From(_) otherwise 1)))