Using DATEADD and NOW() together

dax
whytheq picture whytheq · Apr 13, 2016 · Viewed 11.2k times · Source

If I try adding the following Measure into my DimDate table:

Past6Months = 
IF(
    FIRSTDATE(  'Dates'[FullDate] ) >= DATEADD( NOW(), -7, MONTH ),
    TRUE(),
    FALSE()
    )

I get this error:

The first argument to 'DATEADD' must specify a column.

Answer

WalTig picture WalTig · Apr 19, 2018

What also works: do what DAX is asking you to do. First put TODAY in a column and than refer to that column.

TodayColumn = TODAY()

Past6Months = 
IF(
    FIRSTDATE(  'Dates'[FullDate] ) >= DATEADD( 'MyTable'[TodayColumn], -7, MONTH ),
    TRUE(),
    FALSE()
    )