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
shoaibsam12
New Member

Relative Date filter in DAX

Hi Everyone.

 

I am creating a dashboard for items having expiration dates and want to show how many items are going to expire in 30 days, 60 days, 90 days from Today(). I did that with a relative date filter. The issue is how to include the item which is expired in the past i.e less the today(). 

I want to show the filter results in table

1 ACCEPTED SOLUTION
V-lianl-msft
Community Support
Community Support

Hi @shoaibsam12 ,

 

Please create a what if parameter as the slicer,

Vlianlmsft_0-1639030147467.png

 

then create the following measure and apply it to the visual level filter

Measure = IF(MAX(Sheet2[expiration dates])<=TODAY()+Parameter[Parameter Value],1,0)

Vlianlmsft_1-1639030174829.png

 


Best Regards,
Liang
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

3 REPLIES 3
V-lianl-msft
Community Support
Community Support

Hi @shoaibsam12 ,

 

Please create a what if parameter as the slicer,

Vlianlmsft_0-1639030147467.png

 

then create the following measure and apply it to the visual level filter

Measure = IF(MAX(Sheet2[expiration dates])<=TODAY()+Parameter[Parameter Value],1,0)

Vlianlmsft_1-1639030174829.png

 


Best Regards,
Liang
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

@shoaibsam12 , One of the way, is a measure like

 

calculate(countrows(Table), filter(all('Date'), 'Date'[Date] <= Today() && 'Date'[Date] >= Today() -30 ) )

 

Assume due date is joined with date of date table

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

To count the number of the true value, I have already accomplished it as you have described but another way because my column has blank as well. I created three separate columns and used this formula for each column just changed the no of days.

If('Crew Essential Document Record'[ Expire Date]= BLANK(),0,IF('Crew Essential Document Record'[ Expire Date]< TODAY()+30,1,0))
 
Now when I filter the table based on this then it will not give the exact value and remove the values which are in past from today's date.
 

 

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