Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Laura_May
Frequent 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 appreciated. 

1 ACCEPTED SOLUTION
Kedar_Pande
Super User
Super User

@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

View solution in original post

1 REPLY 1
Kedar_Pande
Super User
Super User

@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

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

Find out what's new and trending in the Fabric community.