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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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
Fabcon_Europe_Social_Bogo

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

Check out the June 2024 Power BI update to learn about new features.

PBI_Carousel_NL_June

Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.