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
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 showing
You 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