我在PowerBI中有一个下面的列,其中Value列有正数、负数和文本。我需要所有这些都在不同的专栏中。
我该怎么做。
值 |
---|
-20.1 |
10 |
31.2 |
上的 |
关闭 |
解除武装 |
武装 |
33 |
-20 |
您可以尝试
let
Source = Table.FromList({"-20.1","10","31.2","on","off","disarmed","armed","33","-20"}, null, {"Values"}),
add_Negative = Table.AddColumn(Source, "Negative", each try if Number.From([Values])<0 then Number.From([Values]) else null otherwise null, type number),
add_Positive = Table.AddColumn(add_Negative, "Positive", each try if Number.From([Values])>0 then Number.From([Values]) else null otherwise null, type number),
add_Text = Table.AddColumn(add_Positive, "Text", each if Text.Remove(Text.From([Values]),{"0".."9","-","."}) = "" then null else [Values], type text)
in
add_Text