Forum Discussion

ginalu's avatar
ginalu
Helper I
1 year ago
Solved

Automatically Setting Default Date Range in Power BI Filter

Question:

I want to set the default range of a date slicer in Power BI to automatically cover the full range from the earliest date to the latest date available in the data. I also want this range to update automatically whenever the data is refreshed. How can I achieve this?

 

  • Hi, ginalu  if you see this, it means that something in your model on this date appears...
    The function takes all the date fields of all tables in the model...
    If you want to limit the slicer by specific column you can create a flag measure like 

    and then use this flag as a filter for the slicer :

    The updated pbix is attached

    If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly

3 Replies

  • Hi ginalu 
    You can create an automatically updated date table based on the data using function calendarauto() .

    this function returns the date range according to the dates of the model so you'll always have it dynamic.

     

    Regarding the second question unfortunately we don't have the functionality of dynamic selection automatically, so the range will be changed, but still, the user should change the selection to change the filter context:

    The automatic selections that we have is only with related date functionality 

    Pbix with the example is attached

    more information about calendarauto () here :
    https://www.youtube.com/watch?v=b23bk6TcXak

    Relative date functionality :
    https://www.youtube.com/watch?v=jT1YuNTpQDU

    If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly

    • ginalu's avatar
      ginalu
      Helper I

      Hi Ritaf1983 ,

       

      Thank you for your response. I tried the suggestion you provided, but I noticed that the filter date is showing a future date of 2034. I would like it to display the maximum value of the existing date data instead.

      • Ritaf1983's avatar
        Ritaf1983
        Super User

        Hi, ginalu  if you see this, it means that something in your model on this date appears...
        The function takes all the date fields of all tables in the model...
        If you want to limit the slicer by specific column you can create a flag measure like 

        and then use this flag as a filter for the slicer :

        The updated pbix is attached

        If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly