Aaron
Aaron

Reputation: 331

Power Query - compare date versus today as boolean

I have a column that contains dates. Is there any function to get TRUE/ FALSE if the date is before TODAY()?

Upvotes: 0

Views: 12941

Answers (1)

horseyride
horseyride

Reputation: 21318

to check if date column is before today's date,

add column .. custom column ..

= [yourdatecolumnname] < DateTime.Date(DateTime.LocalNow())

to test if equal to todays date

 = [yourdatecolumnname] = DateTime.Date(DateTime.LocalNow())

 or 

 =  Date.IsInCurrentDay([yourdatecolumnname])

to test if equal to yesterdays date

 = Date.IsInPreviousDay([yourdatecolumnname])

 or

= [yourdatecolumnname] < Date.AddDays(DateTime.Date(DateTime.LocalNow()),-1)

Upvotes: 5

Related Questions