Forum Discussion

gco's avatar
gco
Resolver II
6 years ago
Solved

Help with filters

Hi there,   I have a calendar table that has fulldate (year) and isPastMonth calculated column.   IsPastMonth = if Date.Month([#"FullDate"]) < Date.Month(DateTime.LocalNow()) then "Y" else "N"  ...
  • gco's avatar
    gco
    6 years ago

    dax Anonymous ,

     

    I was able to fix my problem by modifying the IsLastMonth calculated column as follows:

     

    Old Value:

    IsLastMonth = if Date.Month([#"FullDate"]) < (Date.Month(DateTime.LocalNow()) then "Y" else "N"

     

    New Value:

    IsLastMonth = if (Date.Month([#"FullDate"]) < (Date.Month(DateTime.LocalNow()))) or (Date.Year([#"FullDate"]) < (Date.Year(DateTime.LocalNow())))
    then "Y" else "N"

     

    This allowed the whole 2019 to be past month and January for 2020.

    Thank you

    Glen