Forum Discussion

Laura_May's avatar
Laura_May
Frequent Visitor
1 year ago
Solved

Filter on relative date and include blanks

I'm trying to filter a visualisation to include dates within the last 5 years and blank dates. I've tried creating a measure with an IF statement, but I can't get the syntax right.    Any help is a...
  • Kedar_Pande's avatar
    1 year ago

    Laura_May 

    Create the Measure

    IncludeDates =
    IF(
    ISBLANK(MAX('YourTable'[DateColumn])),
    1, // Return 1 if the date is blank
    IF(
    MAX('YourTable'[DateColumn]) >= EDATE(TODAY(), -60),
    1, // Return 1 if the date is within the last 5 years
    0 // Return 0 otherwise
    )
    )

    Apply the Measure as a Visual Filter

     

    If this helped, a Kudos 👍 or a Solution mark would be awesome! 🎉
    Cheers,
    Kedar Pande
    Connect on LinkedIn