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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
amir_mm
Helper III
Helper III

Between date slicer - default start and end time

Hi,

I’m using a between date slicer and have applied the measure "CurrentDay = 'Dim-Date'[Date] - TODAY()" with a page-level filter set to "less than or equal to 0" so that the default end date is always the current day. However, I want the default start date to be the current day minus 7 days. This way, when a user opens the report, it will only show data from the last 7 days by default, even though the full date range in the slicer still covers all available data.

I’m not sure how to configure this. Any ideas would be greatly appreciated.

 

amir_mm_0-1724179688029.png

 

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

Hi @amir_mm ,

 

You can try below formula to create calculated column and use it to page filter.

CurrentDay = 
VAR StartDate = TODAY() - 7
RETURN
    IF('Dim-Date'[Date] >= StartDate && 'Dim-Date'[Date] <= TODAY(), 1, 0)

vkongfanfmsft_0-1724665133452.png

vkongfanfmsft_1-1724665173340.png

Best Regards,
Adamk Kong

 

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

(Virus scan in progress ...)
8 REPLIES 8
Nobuddy123
New Member

Hi @amir_mm  I am currently facing the same scenario. If you have already found a solution, could you kindly share it with me so I can resolve this issue as well?

Nobuddy123
New Member

Hi @amir_mm  I am currently facing the same scenario. If you have already found a solution, could you kindly share it with me so I can resolve this issue as well?

kushanNa
Advocate I
Advocate I

Good Question, I'm having the same issue , so commenting to get this post to the top 

v-kongfanf-msft
Community Support
Community Support

Hi @amir_mm ,

 

You can try below formula to create calculated column and use it to page filter.

CurrentDay = 
VAR StartDate = TODAY() - 7
RETURN
    IF('Dim-Date'[Date] >= StartDate && 'Dim-Date'[Date] <= TODAY(), 1, 0)

vkongfanfmsft_0-1724665133452.png

vkongfanfmsft_1-1724665173340.png

Best Regards,
Adamk Kong

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

(Virus scan in progress ...)

Thanks for the query. But as I mentioned in the other post and shown in the photo, I still want users to be able to move the slider all the way back to earlier years. So, when a user opens a report, the default view should be the last 7 days, but they should still have the ability to move the toggle back and forth.

looks like someone had mistakenly marked the wrong answer as the correct answer, maybe you might need to create a new post 😕 

vicky_
Super User
Super User

You can use visual level filter on the slicer / page so that your users can only select the last 7 days in the slicer.

vicky__0-1724194392361.png

 

Thanks, but I want users to have full access to the date range in the slicer, with the default view showing the last 7 days. This way, when the report opens, it will display data from the last 7 days by default, but users can still adjust the toggle to select any dates.

Helpful resources

Announcements