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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
MustafaP
Frequent Visitor

Select Slicer default yesterday with all dates showing

Hi Everyone,

I need support for my report, it has data from 2023 till 2025.

I have a date filter and i want to select automaticly yesterday in first openning but with all dates, user can change if they want.

 

Screenshot_13.jpg

for today selected 26.08, but tomorrow when you open this report, i would like to selection default will be 27.08, and goes on.

 

How i can do it?

 

Thank you

1 ACCEPTED SOLUTION

I have check today and refreshed , It is still working for me. 

Let's do it in other way. 

Open power query: Before creating any steps, first sort the date column in ascending order. See image below:

shafiz_p_0-1724841833446.png

 

Create an index column starting from 1.

shafiz_p_1-1724841876402.png


Now do the steps to create only custom column to identify yesterday.

shafiz_p_2-1724841964705.png

 

Again create a condition custom column to sort the custom date column.

shafiz_p_3-1724842067817.png

Now remove the index column and change type of custom column to text and SortIndex column to whole number.

shafiz_p_4-1724842182194.png

Sort the sortindex column in ascending order, and close and load.

shafiz_p_5-1724842220674.png


Go to the table view and sort the custom column by SortIndex column.

shafiz_p_6-1724842333956.png



Hope this will work!!
If this solved your problem, please accept it as a solution!!

Best Regards,
Shahariar Hafiz

View solution in original post

7 REPLIES 7
shafiz_p
Super User
Super User

Hi @MustafaP  Create a custom column in power query to identify yesterday and sorting. See the image below for custom date column.

shafiz_p_0-1724758869611.png

 

Sort in descending order.

 

shafiz_p_1-1724758932752.png


Change type to text.

Now create a slice with the custom column and sort descending.

shafiz_p_2-1724759037681.png

Set slicer setting to only single select. See image below:

shafiz_p_3-1724759165847.png


Now yesterday will always be selected and change automatically each day at the top when you refresh. Alongside, you can filter other day too.

Hope this helps!!
If this solved your problem, please accept it as a solution!!

almost done but sorting not worked.

Screenshot_14.jpg

I have check today and refreshed , It is still working for me. 

Let's do it in other way. 

Open power query: Before creating any steps, first sort the date column in ascending order. See image below:

shafiz_p_0-1724841833446.png

 

Create an index column starting from 1.

shafiz_p_1-1724841876402.png


Now do the steps to create only custom column to identify yesterday.

shafiz_p_2-1724841964705.png

 

Again create a condition custom column to sort the custom date column.

shafiz_p_3-1724842067817.png

Now remove the index column and change type of custom column to text and SortIndex column to whole number.

shafiz_p_4-1724842182194.png

Sort the sortindex column in ascending order, and close and load.

shafiz_p_5-1724842220674.png


Go to the table view and sort the custom column by SortIndex column.

shafiz_p_6-1724842333956.png



Hope this will work!!
If this solved your problem, please accept it as a solution!!

Best Regards,
Shahariar Hafiz

thank you so much...

dharmendars007
Super User
Super User

Hello @MustafaP , 

 

You can create Conditional Column like the below and add it as filter in the filter section to restrict dates till yesterday..

dharmendars007_0-1724751572231.png

dharmendars007_1-1724751610029.png

 

If you find this helpful , please mark it as solution and Your Kudos are much appreciated!

 

Thank You

Dharmendar S

LinkedIN 

 

But i want to report came with yesterday selected.

Hello @MustafaP , 


You can try with the below Calculated column, this is dynamic and use this as Filter.

Condition = IF(TODAY()-1=Dates[Dates], "True", "False")
 
dharmendars007_0-1724764119319.pngdharmendars007_1-1724764277637.png

  

If you find this helpful , please mark it as solution and Your Kudos are much appreciated!

 

Thank You

Dharmendar S

LinkedIN 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.