Forum Discussion
Anonymous
8 years agoNot applicable
Remove leading Zero's in Query
Hi, I need to remove leading zeros from a character string, ideally at query level. I have seen the solution: http://community.powerbi.com/t5/Desktop/Remove-leading-zero-s-from-a-string/m-p/...
- 8 years ago
You can just choose Transform - Foormat - Trim and then adjust the generated code to have zeroes trimmed from the start.
let Source = #table({"String"},List.Zip({{"000MarcelBeug","000Ol"}})), #"Trimmed Text" = Table.TransformColumns(Source,{{"String", each Text.TrimStart(_,"0")}}) in #"Trimmed Text"
MarcelBeug
8 years agoCommunity Champion
You can just choose Transform - Foormat - Trim and then adjust the generated code to have zeroes trimmed from the start.
let
Source = #table({"String"},List.Zip({{"000MarcelBeug","000Ol"}})),
#"Trimmed Text" = Table.TransformColumns(Source,{{"String", each Text.TrimStart(_,"0")}})
in
#"Trimmed Text"banks334
6 years agoFrequent Visitor
This returned for me a table with two values... one being the trimmed value and one being blank...
I had to modify it as follows:
let
Source = #table({"String"},{{[DRNum]}}),
#"Trimmed Text" = Table.TransformColumns(Source,{{"String", each Text.TrimStart(_,"0")}})
in
#"Trimmed Tex- JaydipPatel816 years agoFrequent Visitor
Use Columns from example if you have a column with Numbers, texts, and numbers with leading zeros.
- Anonymous2 years agoNot applicable
This worked for me perfectly and was the easiest solution. Thank you