Reputation: 151
I'm trying to create a new custom column from a conditional statement and current date.
Next picture explains exactly what i need to get with power query.
An example of what I need from pseudocode is:
if [fecha fin de plazo]>=CurrentDate and [fecha CIERRE investigación]=null
then "string"
My biggest problem is I don't know how to extract the current date with PowerQuery.
Upvotes: 0
Views: 1190
Reputation: 151
Using the DateTime.LocalNow you get the date and time of your system, the problem is at time to compareting the date value with the result of DateTime.LocalNow() becsause you need to compare only dates.
That's why It must use DateTime.Date. This fucntion returns the date component of DateTime.LocalNow().
if [date1] >= DateTime.Date(DateTime.LocalNow()) and [date2]=null
then "string"
You can get more information about this functions here:
Upvotes: 1
Reputation: 392
You could try using,
if [fecha fin de plazo]>= DateTime.LocalNow() and [fecha CIERRE investigación]=null
then "string"
Upvotes: 1