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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
viswaaa
Helper IV
Helper IV

How to show today-1 as start date and today as end date by default in date slicer

Hi All,

 

I have created a table like below.

Calendar=CALENDAR(DATE(2020,1,1),TODAY())

and I took date slicer and took between in settings.

 

Now my requirement is I need to show the default dates like start date as today()-1 and the end date as today() 

Please let me know how to do this....

 

2 ACCEPTED SOLUTIONS
v-pnaroju-msft
Community Support
Community Support

Thankyou, @parry2k@Shubham_rai955@MasonMA and @ajaybabuinturi for your responses.

Hi viswaaa,

Thank you for the follow up.

Based on my understanding, Power BI currently does not support setting a dynamic default date range such as Today()-1 to Today() directly in the Between slicer. When a measure based visual filter is applied, it restricts the slicer values to only those dates and disables manual selection.

To dynamically display Yesterday to Today by default while still allowing users to select any past dates, you can use one of the following approaches, which may help to resolve the issue:

  1. Keep your calendar table.
    Calendar = CALENDAR(DATE(2020, 1, 1), TODAY())
    Add a Date slicer. Then go to the Format pane → Slicer settings → Options → Style = Relative. In the slicer dropdown, select Last, then 2, and finally Days. This automatically filters to Yesterday and Today and updates daily. Users can switch the slicer type to Between at any time to choose past dates.

  2. If we want to keep the “Between” style visible, add two slicers using the same Calendar[Date]. One Relative slicer, which is set to Last 2 Days, should be hidden. One Between slicer should be visible to users. Sync both slicers and create a bookmark after setting the relative slicer. Set it as the Default View. This ensures the report opens with Yesterday–Today, but users can freely modify the visible Between slicer.

Additionally, kindly refer to the links provided below:
Create a relative date slicer or filter in Power BI - Power BI | Microsoft Learn
Create report bookmarks in Power BI - Power BI | Microsoft Learn

We hope the information provided helps to resolve the issue. Should you have any further queries, please feel free to contact the Microsoft Fabric community.

Thank you.

View solution in original post

Hi @viswaaa

If you require date selection and Y'day&T'day dates in same slicer it is NOT possible but there is a workaround using bookmarks. You need to use two buttons and and two slicers. When you click on Button1 you will get T'day and Y'day and when click on button2 you will get date selction.

Button1: T'day and Y'day dates

Button2: Date Selection

 

Slicer1 is having previous responce DAX logic which ensures that keep the slicer T'day and Y'day
Slicer2 is having complete date range with out DAX logic.

Use this video to set up this process: https://drive.google.com/file/d/1tsNcJ3F7P1Weq4goW52-NqcALwPkEuaE/view?usp=sharing 

Thanks,
If you found this solution helpful, please consider giving it a Like👍 and marking it as Accepted Solution✔. This helps improve visibility for others who may be encountering/facing same questions/issues.

View solution in original post

11 REPLIES 11
v-pnaroju-msft
Community Support
Community Support

Hi viswaaa,

We are following up to see if what we shared solved your issue. If you need more support, please reach out to the Microsoft Fabric community.

Thank you.

v-pnaroju-msft
Community Support
Community Support

Hi viswaaa,

We would like to follow up and see whether the details we shared have resolved your problem. If you need any more assistance, please feel free to connect with the Microsoft Fabric community.

Thank you.

v-pnaroju-msft
Community Support
Community Support

Thankyou, @parry2k@Shubham_rai955@MasonMA and @ajaybabuinturi for your responses.

Hi viswaaa,

Thank you for the follow up.

Based on my understanding, Power BI currently does not support setting a dynamic default date range such as Today()-1 to Today() directly in the Between slicer. When a measure based visual filter is applied, it restricts the slicer values to only those dates and disables manual selection.

To dynamically display Yesterday to Today by default while still allowing users to select any past dates, you can use one of the following approaches, which may help to resolve the issue:

  1. Keep your calendar table.
    Calendar = CALENDAR(DATE(2020, 1, 1), TODAY())
    Add a Date slicer. Then go to the Format pane → Slicer settings → Options → Style = Relative. In the slicer dropdown, select Last, then 2, and finally Days. This automatically filters to Yesterday and Today and updates daily. Users can switch the slicer type to Between at any time to choose past dates.

  2. If we want to keep the “Between” style visible, add two slicers using the same Calendar[Date]. One Relative slicer, which is set to Last 2 Days, should be hidden. One Between slicer should be visible to users. Sync both slicers and create a bookmark after setting the relative slicer. Set it as the Default View. This ensures the report opens with Yesterday–Today, but users can freely modify the visible Between slicer.

Additionally, kindly refer to the links provided below:
Create a relative date slicer or filter in Power BI - Power BI | Microsoft Learn
Create report bookmarks in Power BI - Power BI | Microsoft Learn

We hope the information provided helps to resolve the issue. Should you have any further queries, please feel free to contact the Microsoft Fabric community.

Thank you.

ajaybabuinturi
Memorable Member
Memorable Member

Hi @viswaaa,

 

I agree with everyone answers but there is workaround to get Start Date as Y'day and End Date as T'day. You can gothrough the below mentioned steps to achive it.

1. I belive you a Calendar Table

Calendar = CALENDAR(DATE(2020,1,1), TODAY())

2. Then create a Dynamic Default Date Range measure which ensures that will return a logical condition (TRUE/FALSE) based on whether the current date falls within the desired default range (TODAY()-1 to TODAY())

DefaultDateRangeFlag = 
Var StartDate = TODAY() - 1
Var EndDate = TODAY()
Var Result =  
IF(MIN(Calendar[Date]) >= StartDate && MAX(Calendar[Date]) <= EndDate, 1, 0)
RETURN
Result

3. Then add this Dynamic Default Date Range measure to the Date slicer visual level filter and set the value equal / is to "1" 

ajaybabuinturi_0-1761716908536.png

 

Finally you can able to see dynamic dates but keep in mind it won't allow you to modify the dates as per your requirement except T'day and Y'day. It will always show the dates as per our DAX logic, Start Date as Y'day and End Date as T'day

Let me know if you have any questions.

Thanks,
If you found this solution helpful, please consider giving it a Like👍 and marking it as Accepted Solution✔. This helps improve visibility for others who may be encountering/facing same questions/issues.

Hi Ajay,

 

But I want to select past dates also if required which is disabled now.

How to get that enable ?

Hi @viswaaa

If you require date selection and Y'day&T'day dates in same slicer it is NOT possible but there is a workaround using bookmarks. You need to use two buttons and and two slicers. When you click on Button1 you will get T'day and Y'day and when click on button2 you will get date selction.

Button1: T'day and Y'day dates

Button2: Date Selection

 

Slicer1 is having previous responce DAX logic which ensures that keep the slicer T'day and Y'day
Slicer2 is having complete date range with out DAX logic.

Use this video to set up this process: https://drive.google.com/file/d/1tsNcJ3F7P1Weq4goW52-NqcALwPkEuaE/view?usp=sharing 

Thanks,
If you found this solution helpful, please consider giving it a Like👍 and marking it as Accepted Solution✔. This helps improve visibility for others who may be encountering/facing same questions/issues.

MasonMA
Community Champion
Community Champion

Hi, instead of 'Between slicer' type, try switching to Relative:

 

MasonMA_1-1761681600385.png

This automatically filters your report to Yesterday and Today by default and it updates daily.

parry2k
Super User
Super User

@Shubham_rai955, every other solution without default settings is not scalable, especially bookmarks. I will refrain from such solutions. Good try though 👍



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Shubham_rai955
Memorable Member
Memorable Member

To set a default date slicer with start date as today minus one and end date as today in Power BI, you need to create two measures and use slicer sync or bookmarks.​

Steps

  • Create your calendar table as:

     
    Calendar = CALENDAR(DATE(2020,1,1), TODAY())
  • Create two measures:

     
    text
    StartDateDefault = TODAY() - 1 EndDateDefault = TODAY()
  • Add a slicer visual using the Calendar table date.

  • To auto-select dates, use slicer bookmarks or set the default values via a filter on the slicer:

    • Filter the slicer to show between StartDateDefault and EndDateDefault.

    • Save this view as a bookmark and set it as default (optional, requires manual action).

Power BI does not currently support dynamic default date selection directly in the slicer, but these steps provide a practical approach using measures and bookmarks.​

 
 
 
 
 
 

 

 
 

Can you please elaborate on this.

After creating measure what I need to do with book marks can you please guide me

parry2k
Super User
Super User

@viswaaa, there is no direct way to set default values in the slicers; this is one of the big asks for the slicers.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.