Forum Discussion
Power Query Drops Leading Zero
Can you share your advance code for the dimension table please
- Anonymous5 years agoNot applicable
Anonymous
Sure, please see it below:
let
Source = Csv.Document(File.Contents("C:\Users\Rhinswind\Desktop\RAW Data Chargebacks BU Information 02-2021.csv"),[Delimiter=",", Columns=24, Encoding=65001, QuoteStyle=QuoteStyle.None]),
#"Promoted Headers" = Table.PromoteHeaders(Source, [PromoteAllScalars=true]),
#"Removed Other Columns" = Table.SelectColumns(#"Promoted Headers",{"Customer Name", "Sales Invoice Number", "BU", "Market Segment", "Vertical Market", "Product Family"}),
#"Inserted Merged Column" = Table.AddColumn(#"Removed Other Columns", "Merged", each Text.Combine({[Sales Invoice Number], [Customer Name]}, "-"), type text),
#"Renamed Columns" = Table.RenameColumns(#"Inserted Merged Column",{{"Merged", "Transaction And Name"}}),
#"Removed Duplicates" = Table.Distinct(#"Renamed Columns", {"Transaction And Name"}),
#"Trimmed Text" = Table.TransformColumns(#"Removed Duplicates",{{"Sales Invoice Number", Text.Trim, type text}}),
#"Cleaned Text" = Table.TransformColumns(#"Trimmed Text",{{"Sales Invoice Number", Text.Clean, type text}})
in
#"Cleaned Text"I tried even to clean and trim it, as i thought it might work.
Please let me know if anything else is needed.
Thank you,
Atanas
- Anonymous5 years agoNot applicable
Odd, out of curiosity is the fact table CSV format? Also, in your original data source the "RAW Data Chargebacks BU Information 02-2021.csv" have you tried formatting the column in the actual CSV document to text?