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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
JDTAYLOR
New Member

Relative Date Filtering

Relative date filtering works for showing values within a time period (i.e. "Last 90 days", Last Year") However, is it possible to filter values outside of a selected time period? For example, I have a work order database. I would like to display all work orders older than 90 days. How could I accomplish this? I am using Direct Query mode so creating a custom is presumably out of the question. 

1 ACCEPTED SOLUTION
v-diye-msft
Community Support
Community Support

Hi @JDTAYLOR 

 

You might try this measure:

 

Outoflast90days=

var a = SELECTEDVALUE('Table 2'[Date])
Return
IF(MAX('Table'[Date])>=a-90&&MAX('Table'[Date])<=a,0,1)

 

table2 is a calendar table, filter the measure with 1, and then you can get the results.

8.PNG

Community Support Team _ Dina Ye
If this post helps, then please consider Accept it as the solution to help the other members find it more
quickly.

View solution in original post

4 REPLIES 4
v-diye-msft
Community Support
Community Support

Hi @JDTAYLOR 

 

You might try this measure:

 

Outoflast90days=

var a = SELECTEDVALUE('Table 2'[Date])
Return
IF(MAX('Table'[Date])>=a-90&&MAX('Table'[Date])<=a,0,1)

 

table2 is a calendar table, filter the measure with 1, and then you can get the results.

8.PNG

Community Support Team _ Dina Ye
If this post helps, then please consider Accept it as the solution to help the other members find it more
quickly.
amitchandak
Super User
Super User

@JDTAYLOR ,Assuming date in slicer is from the date table. Try a measure like


Measure =
var _min = minx(date,date[date])
return
calculate([Measure2],filter(all(date),date[date]<=_min))

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

Thank you for the quick response @amitchandak! What is the significance of "measure2" in your formula?

 

Here is what I have so far.

 

Greater Than 90 Days = var _min = MINX(WKORDER,WKORDER[WO_INIDATE]) return calculate([Measure2],FILTER(ALL(WKORDER),WKORDER[WO_INIDATE]<=_min))

[Measure 2] is any calculation you want to use

count(Table[ID]) or sum(Table[Value])

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

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors