Forum Discussion
Date defaults
- 2 years ago
Hi vafowler If you want your dashboard automatically default to previous day, you can check my earlier solution here:
Select Slicer default yesterday with all dates showingYou can use the same concept to tag the previous 3 days for your second part solution. Only changes would be, instead of single select it would be multiselect. Select previous 3 days using control button.
M code to identify Yesterday, Day before Last, or whatever you want, use the below code in power query.
Custom date =
if [Date] = Date.From(Date.AddDays(DateTime.LocalNow(), -1)) then "Yesterday" else if [Date] = Date.From(Date.AddDays(DateTime.LocalNow(), -3)) then "Day Before Last" else [Date]Hope this helps!!
If this solved your problem, please accept it as a solution, and a thumps up!!
Best Regards,
Shahariar Hafiz
Thank you. I wound up creating a calculated column using binary to determine previous day, which worked. I am still trying to figure out the weekend part. The trouble is I need both of them on the same page. The previous day filter how I did it works great- except until next Monday comes around and I need to show 3 days. Is there a way to default to the weekend but only if the current day is Monday else prev day?
I will take a lot at the link you provided.
- shafiz_p2 years agoSuper User
I did not get what you want actually. Is that what you want, if today is monday, then it will show previous 3 days and if not monday then it will show previous day.
This is on / off situation. How do you implement such scenario. As far as I understand, that slicer default must always be on.
If this is your case, then 1 day in a week it will be 3 selected day, and all the other day it will be single selected.- vafowler2 years agoNew Member
I don't think I am explaining it very well. I will try your solution you provided and remove what I did since it doesn't seem to be working anyway. Thanks again.