Add new Power Query functions and update settings for improved data handling
This commit is contained in:
20
power-query/fFixCSVDates.m
Normal file
20
power-query/fFixCSVDates.m
Normal file
@@ -0,0 +1,20 @@
|
||||
let
|
||||
Func = (SourceText as nullable text) as date =>
|
||||
let
|
||||
CheckSlashes = Text.Contains(SourceText, "/"),
|
||||
TryToConvert = if CheckSlashes then
|
||||
let
|
||||
SplitText = Text.Split(SourceText, "/"),
|
||||
Parse = try Date.From(#date(Number.From(SplitText{2}),
|
||||
Number.From(SplitText{0}),
|
||||
Number.From(SplitText{1})
|
||||
) )
|
||||
otherwise null
|
||||
in
|
||||
Parse
|
||||
else
|
||||
Date.From(SourceText)
|
||||
in
|
||||
TryToConvert
|
||||
in
|
||||
Func
|
||||
Reference in New Issue
Block a user