Forum Discussion
SACooper
Helper II
2 years agoCleaning non-helpful date formatting
I have a date source which is very unhelpful in that it produces date/time fields in text as Today at 11:15 am, yesterday at 2:46 pm, Tuesday at 3:21 pm and so on until we are a week out then we ...
- 2 years ago
You could check which day in the next week has a matching day-of-week name.
For example, add a custom column like this:
List.First( List.Select( List.Dates( Date.AddDays([Date created], 1), 7, #duration(1,0,0,0) ), (d) => Date.DayOfWeekName(d) = Text.BeforeDelimiter([#"Date/Time"], " " ) ) )
AlexisOlson
Super User
2 years agoYou could check which day in the next week has a matching day-of-week name.
For example, add a custom column like this:
List.First(
List.Select(
List.Dates(
Date.AddDays([Date created], 1),
7,
#duration(1,0,0,0)
),
(d) => Date.DayOfWeekName(d)
= Text.BeforeDelimiter([#"Date/Time"], " " )
)
)
- SACooper2 years ago
Helper II
Thank you -- this is amazing and was the key to solving the problem had to do a bit of date math after but was simple enough and got me where I needed to be!!