0
votes

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.

THIS IMAGE EXPLAIN WHAT I WANT TO DO

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.

2

2 Answers

1
votes

You could try using,

if [fecha fin de plazo]>= DateTime.LocalNow() and [fecha CIERRE investigación]=null
then "string"

DateTime.LocalNow()

1
votes

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:


DateTime.LocalNow()
DateTime.Date()