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
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
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.