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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
alicia_pbi
Microsoft Employee
Microsoft Employee

auto select max date from slicer

Is there a way to default a date slicer in a report to select the max date?  I have a report that I am presenting with a source from SQL.  I want the report to auto select the max or most recent snapshot date so that I don't have to go to the workspace and change after every new snapshot.  I know I can use advanced filtering on the filter but I want the end user to always see the latest date on the slicer with the ability to use the slicer to see previous snapshots.  Is this possible?

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Thanks for the replies from johnt75. Attaluri and Rupak_bi.

 

Hi @alicia_pbi ,

 

You can use preselected slicer to achieve this effect:

vlinhuizhmsft_0-1732774747603.png

I create simple test data:

vlinhuizhmsft_1-1732775239519.png

Create a measure:

Pre selection = 
VAR _select=SELECTEDVALUE('Table'[Date])
RETURN
_select=TODAY()

 

Create a calculated table:

_PreselectedSlicer = DATATABLE("IsDirty", BOOLEAN ,{{False()},{True()}})

 

Result:

vlinhuizhmsft_2-1732775540425.png

 

Best Regards,
Zhu

 

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

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Thanks for the replies from johnt75. Attaluri and Rupak_bi.

 

Hi @alicia_pbi ,

 

You can use preselected slicer to achieve this effect:

vlinhuizhmsft_0-1732774747603.png

I create simple test data:

vlinhuizhmsft_1-1732775239519.png

Create a measure:

Pre selection = 
VAR _select=SELECTEDVALUE('Table'[Date])
RETURN
_select=TODAY()

 

Create a calculated table:

_PreselectedSlicer = DATATABLE("IsDirty", BOOLEAN ,{{False()},{True()}})

 

Result:

vlinhuizhmsft_2-1732775540425.png

 

Best Regards,
Zhu

 

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

johnt75
Super User
Super User

Yes, with some setup. You need to create a copy of the column you want to slice by, lets assume its called 'Table'[Datestamp]. You would create a new calculated column in the same table like

Datestamp for slicer =
VAR LastDatestamp =
    CALCULATE ( MAX ( 'Table'[Datestamp] ), REMOVEFILTERS () )
VAR Result =
    IF (
        'Table'[Datestamp] = LastDatestamp,
        "Most Recent",
        FORMAT ( 'Table'[Datestamp], "dd/mm/yyyy" )
    )
RETURN
    Result

Hide this new column from users in report view.

Open Tabular Editor, select the 'Table'[Datestamp] column and under Options set "Group by columns" to include 'Table'[Datestamp for slicer].

Now when you use 'Table'[Datestamp] in the slicer, Power BI will actually store the value of the new 'Table'[Datestamp] column, so if you have selected the most recent date it will store "Most recent". When your report refreshes, "Most recent" will now equate to the most recent datestamp and so that is what will be selected in the slicer.

You should be aware that this will break in Excel if users try to use 'Table'[Datestamp] in a report. If that happens you can create 2 new columns, one an exact replica of 'Table'[Datestamp] which you will only use in the slicer and the other as described above.

Attaluri
Frequent Visitor

You can create a flag column in date table. It will show "Latest Date" for current date and for rest of the rows it just shows the dates. You can use this column as slicer and fillter on latest Date. Using this approach every time you open the report you see latest date selected in report. 

Rupak_bi
Super User
Super User

Hi @alicia_pbi ,

 

Inside Slicer its not possible (to the best of my knowledge). But there is an alternet way to achive this.
1. Create a measure like below and use that measure to filter your report. 
Max_Date = selectetvalue(table[date]),max(table[date]))
2. keep the slicer sepatate with the same date column.
by this way the measure will select the max date if nothing is selected in the slicer, else it will select the slicer date.

Rupak_bi_0-1732196562638.png

Rupak_bi_2-1732196646986.png

 

 

 



Regards
Rupak
FOLLOW ME : https://www.linkedin.com/in/rupaksar/

Helpful resources

Announcements
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.