【发布时间】:2022-12-12 14:44:21
【问题描述】:
我正在尝试添加一个自定义列以通过这种方式将 2 列(Col3 和 Col4)的值与自定义函数 fnMyFunction() 的结果组合起来
#"Added Custom" = Table.AddColumn(#"Previous Step", "Custom Column",
each
Text.Combine(
{
[Col3],
[Col4],
fnMyFunction([Col5],[Col6])
}
)),
当函数处理空值时出现此错误
Expression.Error: We cannot convert the value null to type Text.
Details:
Value=
Type=[Type]
函数fnMyFunction是这样的:
(input1 as text, input2 as text)=>
let
Inputs = {input1, input2},
SplitAndZip = List.Zip(List.Transform(Inputs, each Text.ToList(_))),
OtherStep
...
..
LastStep
in
LastStep
我试图在 Input 步骤中添加 if else 以获取空作为函数的输出但不起作用
(input1 as text, input2 as text)=>
let
Inputs = if input1 <> null then {input1, input2} else {"",""}, //Added "if else" here
SplitAndZip = List.Zip(List.Transform(Inputs, each Text.ToList(_))),
OtherSteps
...
..
LastStep
in
LastStep
怎么解决这个问题?
【问题讨论】:
标签: powerbi powerquery m