Forum Discussion
ahamedafridi18
2 years agoFrequent Visitor
How do i extract date from the source name which has string using power query
i have exported csv dat which has got date in their source name. it is a daily download report. i want to create a custom column which extracts the date from the source name so that i can cretae the ...
m_dekorte
2 years agoResident Rockstar
Hi ahamedafridi18,
There are so many different ways to achieve that, just wondering how representative the image is...
For example any of these will do, just insert a Custom Column and copy an expression from below, replace "Source" with the column reference [Source.Name]
let
Source = "Detroit 21-02-2024.xlsx",
AlwaysBetween = Text.BetweenDelimiters(Source, " ", "."),
AtTheEnd = List.Reverse( Text.SplitAny( Source, " .") ){1}?,
Anywhere = List.First( List.Select( Text.SplitAny( Source, " ."), each Text.Length( Text.Select(_, {"-"}) )=2 ))
in
Anywhere
I hope this is helpful