Forum Discussion
Laura_May
1 year agoFrequent Visitor
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...
- 1 year ago
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
Kedar_Pande
Super User
1 year agoCreate 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