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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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

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

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
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.