[英]PowerBi How to extract characters from a column into 3 columns
how are you all doing?你们都还好吗?
I need some help with the data im working on, I'm trying to breakdown a column into three new columns on PowerBI我需要一些关于正在处理的数据的帮助,我正在尝试在 PowerBI 上将一列分解为三个新列
Conditions条件
The following changes this:以下内容对此进行了更改:
to this:对此:
let
Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Score", type text}}),
#"Replaced Value" = Table.ReplaceValue(#"Changed Type","%","",Replacer.ReplaceText,{"Score"}),
#"Added Custom" = Table.AddColumn(#"Replaced Value", "Left", each if [Score] <> null then let check = try Number.From(Text.At([Score],0)) in if check[HasError] then Text.At([Score],0) else "" else ""),
#"Added Custom1" = Table.AddColumn(#"Added Custom", "Actual %", each if [Score] <> null then Text.Select([Score],{"0","1","2","3","4","5","6","7","8","9","."}) else ""),
#"Added Custom2" = Table.AddColumn(#"Added Custom1", "Right", each if [Score] <> null then let check = try Number.From(Text.At([Score],Text.Length([Score])-1)) in if check[HasError] then Text.At([Score],Text.Length([Score])-1) else "" else "")
in
#"Added Custom2"
How about怎么样
let Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Column1", type text}}),
#"Added Custom" = Table.AddColumn(#"Changed Type", "Left", each if Value.Is(Value.FromText(Text.Start([Column1],1)), type text) then Text.Start([Column1],1) else null),
#"Added Custom1" = Table.AddColumn(#"Added Custom", "Right", each if Value.Is(Value.FromText(Text.End([Column1],1)), type text) then Text.End([Column1],1) else null),
#"Added Custom2" = Table.AddColumn(#"Added Custom1", "Actual%", each Text.Select([Column1],{Character.FromNumber(48)..Character.FromNumber(57) } ))
in #"Added Custom2"
Column1第 1 列 |
---|
D86W D86W |
A45 A45 |
A88W A88W |
88W 88W |
88% 88% |
A85W A85W |
A66 A66 |
70W 70W |
99% 99% |
88 88 |
89W 89W |
D86W D86W |
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.