Forum Discussion

diyannavarro's avatar
diyannavarro
Frequent Visitor
7 years ago
Solved

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...
  • edhans's avatar
    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.