Forum Discussion

ChadPortman's avatar
ChadPortman
Frequent Visitor
5 years ago
Solved

Anchor date on Slicer

I have a date slicer in my report that will allow the user to select any date or date range they want to view. However I want the default view to always be the most recent date only. The data gets updated every night. So for example today is 3/10 so the most recent date in the data set will be 3/9 and I want my date slicer to show 3/9-3/9. Tomorrow on 3/11 the most recent date is 3/10 but currently the slicer is showing 3/9-3/10 and this gets worse as time goes on as the start date on the slicer stays with whatever I uploaded the file as while the end date updated to the most recent. The most important aspect is that I need the end user to be able to select any date or date range that exist in the data but have the default be a single day view of the most recent info.

 

Any thoughts? Thanks.

  • Hi ChadPortman ,

     

    It is not supported in Power BI. When you select a single date value in your slicer and dataset is refreshed, the selected value won't change to the latest one automatically. It is needed to use Relative Date slicer. But it doesn't meet your requirements. 

     

    Then, one workaround, create a column like below and use this column as the slicer, set the default value as "yesterday".

    Modified Date = IF( 'Your Table'[Date] = MAX( 'Your Table'[Date] ), "yesterday", 'Your Table'[Date] )

     

     

    Best Regards,

    Icey

     

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

1 Reply

  • Icey's avatar
    Icey
    Community Support

    Hi ChadPortman ,

     

    It is not supported in Power BI. When you select a single date value in your slicer and dataset is refreshed, the selected value won't change to the latest one automatically. It is needed to use Relative Date slicer. But it doesn't meet your requirements. 

     

    Then, one workaround, create a column like below and use this column as the slicer, set the default value as "yesterday".

    Modified Date = IF( 'Your Table'[Date] = MAX( 'Your Table'[Date] ), "yesterday", 'Your Table'[Date] )

     

     

    Best Regards,

    Icey

     

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