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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
Bakhtawar
Post Patron
Post Patron

automatically yesterday selection

i have data field .. i drag that field in dropdown box .. so i want automtically selection on yesterday dates

 

means if today is march 5, 2020 .. then i want march 4, 2020 selection when ever i open the report'

if tommorrow is march 6, 2020 then date om dropdown should be  march 5,2020

 

any help

 

yet i did not try anything

9 REPLIES 9
amitchandak
Super User
Super User

Check if, this

https://community.powerbi.com/t5/Desktop/Setting-default-date-slicer-to-yesterday/td-p/523171

or

https://www.youtube.com/watch?v=lkHFpmA4SJ4

can help

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
v-alq-msft
Community Support
Community Support

Hi, @Bakhtawar 

 

Based on your description, I created data to reproduce your scenario.

 

DateTable = CALENDAR(DATE(2020,1,1),DATE(2020,6,30))

 

 

You may create two measures as follows.

 

IsYesterday = 
IF(
    TODAY()-1 = MAX(DateTable[Date]),
    1,0
)

IsTomorrow = 
IF(
    TODAY()+1 = MAX(DateTable[Date]),
    1,0
)

 

 

Then you can create two slicers with Date column and put the measure to the corresponding visual level filter of the visual. Today is 3/6/2020. Here is the result.

b1.png

b3.png

 

 

Best Regards

Allan

 

 

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

i tried your solution and it worked @v-alq-msft  but i want to displayed date instead of ALL text ? is this possible .. like now ALL is dsiplayed when i opened report.. but i want to displayed date instead of ALL

 

Hi, @Bakhtawar 

 

You need to click the icon because the slicer is dropdown type.

e1.PNG

e2.PNG

 

For convenience, you may change it to 'list'.

e3.png

 

Best Regards

Allan

 

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

i know.. but i dont want this "ALL" text.. i want to just display date instead of ALL text.. means no need for selection/click

@v-alq-msft 

Hi, @Bakhtawar 

 

Based on my tests, I think it is unsupported to select a value in a slicer automatically by default. The selectable value of a slicer changes with the context, but the selected value cannot be changed automatically. So you can see yesterday is selectable. However it can't be selected automatically.

 

Best Regards

Allan

 

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

ok is this possible to display other dates with highlight of yesterday date in dropdown .. it seems like only yesterday date is displayed.. if we want to display other date with highlight of yesterday date ? then is this possible.. however your solution is worked for display date @v-alq-msft 

amitchandak
Super User
Super User

In case you want only one measure do it like

Yesterday = CALCULATE(SUM(Sales[Sales Amount]),'Date'[Date] =Today()-1)

 

For everything, use relative date slicer

https://docs.microsoft.com/en-us/power-bi/visuals/desktop-slicer-filter-date-range

 

Appreciate your Kudos.

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Greg_Deckler
Community Champion
Community Champion

See if this thread helps:
https://community.powerbi.com/t5/Desktop/Setting-the-Default-Value-of-a-Slicer/td-p/16442


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

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.

Top Solution Authors
Top Kudoed Authors