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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

Filter 2 Relative Dates

Hi,

 

I'm looking to filter a visual with 2 relative dates (see below). However, if I apply this to the visual it applies AND logic but I want OR logic, i.e., filter if the date is in the last 7 days OR in the next 30 days. I'm thinking this isn't out of the box and I'll need DAX but aren't sure what that would be.

 

Thanks! 🙂

 

mccardj_0-1664242368911.png

 

3 REPLIES 3
amitchandak
Super User
Super User

@Anonymous , Relative date is based on today. You can do that by creating a measure based on today without using a slicer. You can use this measure in the visual or visual level filter

 

 

This Month Today =
var _min = today() -7
var _max =today()+30
return CALCULATE([Net], FILTER('Date','Date'[Date] >=_min && 'Date'[Date] <= _max))

 

Net is measured and net's table is joined with date table 

 

 

refer https://medium.com/chandakamit/cheat-sheet-power-bi-time-intelligence-formulas-using-today-654f26e27304

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Hi @amitchandak would love some more help if you could please 🙂

Anonymous
Not applicable

Hi - what does Net refer to? And do I need to create the date table - where does that come from?

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.