Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
I have a list of all project dates - dates in a list, and a list of out-of-office dates - dates as strings in a list.
When I List.Difference([All Project Dates], [OOO Dates]), it obviously doesn't work.
How can I transform/convert a list of dates as strings into a list of dates as dates? Or vice versa?
Thanks!
Solved! Go to Solution.
The function to convert text > date is Date.FromText.
You could apply it in this case by changing
[OOO Dates]
to
List.Transform( [OOO Dates], each Date.FromText(_[Format="M/d/yyyy"]) )
within your existing code.
You could also add a separate step with Table.TransformColumns to transform the [OOO Dates] column from text list to date list, and then apply List.Difference.
= Table.TransformColumns(
PreviousStep,
{ {"OOO Dates", each List.Transform(_, each Date.FromText(_, [Format = "M/d/yyyy"]) ), type {date}} }
)
Are you able to get this working?
Thank you! I have been running in circles for almost an hour. Much appreciated!!
The function to convert text > date is Date.FromText.
You could apply it in this case by changing
[OOO Dates]
to
List.Transform( [OOO Dates], each Date.FromText(_[Format="M/d/yyyy"]) )
within your existing code.
You could also add a separate step with Table.TransformColumns to transform the [OOO Dates] column from text list to date list, and then apply List.Difference.
= Table.TransformColumns(
PreviousStep,
{ {"OOO Dates", each List.Transform(_, each Date.FromText(_, [Format = "M/d/yyyy"]) ), type {date}} }
)
Are you able to get this working?