Forum Discussion

kart-6118's avatar
kart-6118
Frequent Visitor
6 months ago
Solved

Default date for Date between slicer

Hi, I am using a Date Range slicer in Power BI configured in "Between" mode to allow users to dynamically select a start and end date.
My requirement is for the slicer to default automatically to a range starting from the first day of the current month up to the maximum available date in the date table (or fact table) when the report loads.

 

However, I also need the slicer to remain fully flexible so that users can manually adjust the start date to an earlier period if required.

 

I attempted to use the Relative Date filter, but it strictly enforces the selected relative range and does not allow users to move the start date beyond that default window.

Is there a recommended approach to:

  • Dynamically set the initial slicer selection (Start of Current Month → Max Date)
    While still allowing users to expand start date to earlier manually?
  • Hi kart-6118 ,

    This Requirement that you are having may not be directly possible in a straight forward fashion.

     

    You can have a separate date table that has the start date as the first day of current month and the end date as max date available using DAX as a calculated table. This Column can be used in your slicer to drive the data.

     

    But the other requirement of going before the current date if needed, may not be suitable to achieve using this method.

     

    Alternatively, you can create a custom column that flags 1 for any date from month start to max date and otherwise it should have 0. Using this you can control the date slicer with this new flag column slicer.

     

    Alternatively, you can also try the solution posted by cengizhanarslan for achieving this requirement using Bookmarks

     

    Regards,

8 Replies

  • Hi kart-6118 ,

    This Requirement that you are having may not be directly possible in a straight forward fashion.

     

    You can have a separate date table that has the start date as the first day of current month and the end date as max date available using DAX as a calculated table. This Column can be used in your slicer to drive the data.

     

    But the other requirement of going before the current date if needed, may not be suitable to achieve using this method.

     

    Alternatively, you can create a custom column that flags 1 for any date from month start to max date and otherwise it should have 0. Using this you can control the date slicer with this new flag column slicer.

     

    Alternatively, you can also try the solution posted by cengizhanarslan for achieving this requirement using Bookmarks

     

    Regards,

    • kart-6118's avatar
      kart-6118
      Frequent Visitor

      If i create a custom column that flags 1 and 0, Still it is not allowing me to select the earlier dates.

      This is the solution i have suggested. By default it will be last 2 months, If i select all dates it will show all:

      But i want it like this. Having the date between slicer defaulted to last 2 month while still allowing user to select earlier dates:


      Anyway can i achieve this without extra buttons but just with a reset button.

       

  • hello kart-6118 

     

    i am not sure if you can do this by using measure then transform into column but nonetheless i doubt there is a direct way to do this since between slicer only accept column value with date format.

     

    however there is a way around to do this with some manual labor every month.

    1. save your pbi with date filter set into first date on current month

     

    2. if you want to publish into workspace or service, the saved date in date slicer will be a default. even the user reset the visual, it will go back to the saved date.

     

    3. by this, your default visual will be set into first date on current month but it will not delete any date before first date on current month so you can go back to previous date.

     

    however, this will require you to re-save your date slicer in pbi file every first date of ongoing month.

     

    Hope this will help.

    Thank you.

  • kart-6118's avatar
    kart-6118
    Frequent Visitor

    Iam already doing the same thing, I don't want to keep on changing the date slicer every month. Is there any workaround for this to change it dynamically.

  • Step 1) Add a flag column in your Date table

    IsCurrentMonth =
    VAR StartMonth = DATE ( YEAR ( TODAY() ), MONTH ( TODAY() ), 1 )
    VAR EndMonth   = EOMONTH ( TODAY(), 0 )
    RETURN
    IF ( 'DimDate'[Date] >= StartMonth && 'DimDate'[Date] <= EndMonth, 1, 0 )

     

    Step 2) Use that flag as the default filter

    • Add DimDate[IsFromCurrentMonth] to Page filters

    • Set it to 1

    Now when the report opens, visuals default to current month

     

    Step 3) Add Bookmarks to toggle Current Month ON/OFF

    Create two bookmarks so users can switch between default and custom ranges:

    Bookmark 1 — “Current Month (Default)”

    • IsCurrentMonth = 1 in filters

    • Save bookmark with Data = ON

    Bookmark 2 — “Custom Range”

    • Remove the IsCurrentMonth filter

    • Save bookmark with Data = ON

    Add buttons linked to each bookmark.

  • v-ssriganesh's avatar
    v-ssriganesh
    Community Support

    Hello kart-6118,
    Thank you for posting your query in the Microsoft Fabric Community Forum.

    Power BI does not natively support setting a dynamic default (for example, “Last 2 Months”) on a Between date slicer while keeping all dates selectable, please try below workarounds:
    • Keep the Date slicer in Between mode with no limiting filters
    • Apply the “default range” logic (for example, last 2 months or current month) as a page or report-level filter to initialize the report when it loads
    This initializes the view dynamically and still allows users to manually expand the date range earlier.

    Thanks, Thejeswarcengizhanarslan & Irwan for sharing valuable insights.
    Best regards,
    Ganesh Singamshetty.
  • v-ssriganesh's avatar
    v-ssriganesh
    Community Support

    Hello kart-6118,

    We hope you're doing well. Could you please confirm whether your issue has been resolved or if you're still facing challenges? Your update will be valuable to the community and may assist others with similar concerns.

    Thank you.

  • v-ssriganesh's avatar
    v-ssriganesh
    Community Support

    Hello kart-6118

    Could you please confirm if your query has been resolved by the provided solutions? This would be helpful for other members who may encounter similar issues.

     

    Thank you for being part of the Microsoft Fabric Community.