Forum Discussion
diyannavarro
7 years agoFrequent Visitor
Power Query for Date If Statement
I have two columns in my date which is approval date and expiry date, and I need to apply this condition using M query: If Approval date <= Current Date and Expiry Date >=Current Date then "Activ...
- 7 years ago
Try wrapping Date.TimeLocalNow() with DateTime.Date(), so DateTime.Date(DateTime.LocaNow())
DateTime.LocalNow will returns the date and time, and you may get comparison errors if you are comparing strictly to a date. DateTime.Date will strip out the time component.
edhans
7 years agoCommunity Champion
Try wrapping Date.TimeLocalNow() with DateTime.Date(), so DateTime.Date(DateTime.LocaNow())
DateTime.LocalNow will returns the date and time, and you may get comparison errors if you are comparing strictly to a date. DateTime.Date will strip out the time component.