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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
YogiK
Frequent Visitor

Setting default date slicer to yesterday

Hi Everyone, 

 

I am currntly working on making a date slicer defalt as yeaterday. 

data should show from begin till yeartday's date.  and also allow user to choose any date they want. Is this posible in power bi ?

I would appricate any help.

Thank you so much. 

1 ACCEPTED SOLUTION
marclelijveld
Resolver I
Resolver I

Hi @YogiK

You can use the relative date slicer in Power BI. Very simple 🙂 In the example below I only use current year, but of course you can also use other timeframes. 
1. Create a slicer with your date column. 
2. At the right top of the slicer, choose Relative as slicertype. 
3. Now you will have 3 items to fill in your slicer, set them like the following: | This | - | Year |
4. Open the Format pane for your slicer and open the Date Range options. 
5. Set the toggle for Include today to off. 

If you publish your report with this filter applied, the default applied filter will be the current year, so that it all data since the beginning of this year, like Year to Date. But be warned, if you allow end-users to save filters to the report in the Power BI service, this may result in other applied filters then the the filters you want to apply by default. You can change this in Power BI desktop in: File > Options > Report settins > Persistent filters

Users can change this period by selecting an other period, like last month or something else in the relative slicer. If you want give them the abbility to select a specific date, you can also add a second slicer or give users the ability to change the relative slicer to any other type of slicer them selves (see step 2 above). Users can change the filtertype themselves as long as you haven't disabled visuals headers. 

Will this work for you? 

- Marc 

View solution in original post

3 REPLIES 3
marclelijveld
Resolver I
Resolver I

Hi @YogiK

You can use the relative date slicer in Power BI. Very simple 🙂 In the example below I only use current year, but of course you can also use other timeframes. 
1. Create a slicer with your date column. 
2. At the right top of the slicer, choose Relative as slicertype. 
3. Now you will have 3 items to fill in your slicer, set them like the following: | This | - | Year |
4. Open the Format pane for your slicer and open the Date Range options. 
5. Set the toggle for Include today to off. 

If you publish your report with this filter applied, the default applied filter will be the current year, so that it all data since the beginning of this year, like Year to Date. But be warned, if you allow end-users to save filters to the report in the Power BI service, this may result in other applied filters then the the filters you want to apply by default. You can change this in Power BI desktop in: File > Options > Report settins > Persistent filters

Users can change this period by selecting an other period, like last month or something else in the relative slicer. If you want give them the abbility to select a specific date, you can also add a second slicer or give users the ability to change the relative slicer to any other type of slicer them selves (see step 2 above). Users can change the filtertype themselves as long as you haven't disabled visuals headers. 

Will this work for you? 

- Marc 

Thank you so much really appricate your help. I will definatly try this.

You're welcome. 
If this works for you, can you please mark this as a solution. So others can use it as well 🙂 

- Marc

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.