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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request 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
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors