Forum Discussion
Magdoulin1
2 years agoNew Member
Replacing Errors in Power Query
Hello everyone, I am trying to replace errors in one of the columns by the below function but it does not work, what kind of modifction I need to apply in the below code? That is a sample of...
- 2 years ago
Hi Magdoulin1,
Your requirement is unclear, what are you aiming to achieve?
For example this will get what you appear to be after but other than that ???let Source = Table.FromList( {"May 2023,#(lf)June 2023"}, Splitter.SplitByNothing(), type table[Service Period=text] ), insertMinimum = Table.AddColumn(Source, "Minimum", each List.Min( List.Transform( Text.Split([Service Period], "#(lf)"), Date.From ))) in insertMinimumIt yields this outcome.
I hope this is helpful
m_dekorte
2 years agoResident Rockstar
Hi Magdoulin1,
Your requirement is unclear, what are you aiming to achieve?
For example this will get what you appear to be after but other than that ???
let
Source = Table.FromList( {"May 2023,#(lf)June 2023"}, Splitter.SplitByNothing(), type table[Service Period=text] ),
insertMinimum = Table.AddColumn(Source, "Minimum", each List.Min( List.Transform( Text.Split([Service Period], "#(lf)"), Date.From )))
in
insertMinimum
It yields this outcome.
I hope this is helpful
Anonymous
2 years agoNot applicable
Great! I never know that Date.From can add 1 as day value when the source date lacks day. Thanks for this simple solution!
Your code will work if you add a whitespace after 1. This can make them be recognized as date correctly.
Best Regards,
Jing