Forum Discussion

AnttiKoskinen's avatar
AnttiKoskinen
Frequent Visitor
3 years ago
Solved

Dateadd when dynamic date filter

My scenario is this:   I take end of each month a montly freeze of a set of data with last day of the month as the effective date and as a field Effective date to a table (fact_table). So thousands...
  • johnt75's avatar
    johnt75
    3 years ago

    The problem is that the DATEADD is returnin 28 November, which has no data. Try

    Reported value 3MO Ago =
    VAR CurrentDate =
        LOOKUPVALUE ( 'Date'[Date], 'Date'[Is Last Effective Date], 1 )
    RETURN
        CALCULATE (
            [Reported value],
            TREATAS ( { EOMONTH ( CurrentDate, -3 ) }, 'Date'[Date] )
        )