Forum Discussion
Date TIme Change
- 1 year ago
- Read in the CSV document.
- Convert column data type to datetime using locale equals english-us.
- Add custom column for finish formula: [Start] + #duration(0,10,0,0)
- See if that gives you what you want
I'm afraid I have no idea what you're doing or how it relates to the code I provided. Please try to clarify.
Providing a better description of exactly what you want for output as well as the code that you are using from the advanced editor might be helpful.
Im not using M Code, apologies
I am using steps in power query. However here is the code - im not a programmer 🙂
let
Source = Csv.Document(File.Contents("csv"),[Delimiter=",", Columns=8, Encoding=65001, QuoteStyle=QuoteStyle.None]),
#"Promoted Headers" = Table.PromoteHeaders(Source, [PromoteAllScalars=true]),
#"Added Custom Column" = Table.AddColumn(#"Promoted Headers", "Custom", each Text.Combine({Text.Middle([Start], 3, 3), Text.Start([Start], 2), Text.Middle([Start], 5), " PM"}), type text),
#"Filtered Rows" = Table.SelectRows(#"Added Custom Column", each ([Start] <> "") and ([Finish] <> "")),
#"Changed Type" = Table.TransformColumnTypes(#"Filtered Rows",{{"Custom", type datetime}}),
#"Added Custom" = Table.AddColumn(#"Changed Type", "Custom.1", each DateTimeZone.SwitchZone(DateTimeZone.From([Custom]), 10))
in
#"Added Custom"
- ronrsnfld1 year agoSuper User
And what do you expect for output ?
Why are you still using that function that I explained to you why it wouldn't work?
- Babycakes_001 year agoHelper I
It converted my whole file to this
- ronrsnfld1 year agoSuper User
- Read in the CSV document.
- Convert column data type to datetime using locale equals english-us.
- Add custom column for finish formula: [Start] + #duration(0,10,0,0)
- See if that gives you what you want