Forum Discussion
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
- Greg_DecklerCommunity ChampionSee if this thread helps:
https://community.powerbi.com/t5/Desktop/Setting-the-Default-Value-of-a-Slicer/td-p/16442 - amitchandakSuper 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.
- v-alq-msftCommunity 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.
Best Regards
Allan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- BakhtawarPost Patron
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
- v-alq-msftCommunity Support
Hi, Bakhtawar
You need to click the icon because the slicer is dropdown type.
For convenience, you may change it to 'list'.
Best Regards
Allan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.