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
ssspk
Helper III
Helper III

Date Slicer between with custom scenario of last 30 days of data first time and change it later?

Hi Team,

 I have a custom scenario for date slicer between.
I have a dashboard which contains a Date slicer(between) for user to select different month of data, the data will refreshed every day.
However, I don't know how to make the slicer automatically pointing to the last 30 days from refresh date or MAX(date) available in table.
From date as 30 days before date and To date is last refresh date or  MAX(date) available in table.
The above scenario should work when user clicks the report page or navigate from different page.
As a second scenario after seeing the last 30 days data in the same page/screen, if the user selects the from_date and to_date in the between slicer based on the slicer it should reflect the data in screen.
Has any one come across this situation scenario?

2024-09-17_13h51_19.png

 

 

 

date_color.png

 


Thank you.

 

1 ACCEPTED SOLUTION
lbendlin
Super User
Super User

Why not use the Relative Date options in the Filter Pane?

View solution in original post

2 REPLIES 2
dharmendars007
Super User
Super User

Hello @ssspk , 

 

As suggest by other you can use "Relative Dates" filter and also as an alternative you can create calculated column in your table which can be used as slicer for last30days..

 

Use this code below

 

IsInLast30Days =
VAR MaxDate = MAX('YourTable'[DateColumn])
RETURN IF(
'YourTable'[DateColumn] >= MaxDate - 30 && 'YourTable'[DateColumn] <= MaxDate,1,0)

 

If you find this helpful , please mark it as solution and Your Kudos/Likes are much appreciated!

 

Thank You

Dharmendar S

LinkedIN 

lbendlin
Super User
Super User

Why not use the Relative Date options in the Filter Pane?

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.