Reputation: 198
How can I achieve the following?
I want to always filter for yesterday's date. BUT, if there is no date recorded for yesterday, then filter for friday and saturday instead.
Upvotes: 0
Views: 53
Reputation: 3741
I think this should help you:
First -> check if the current day is Monday Second -> if so go back 3 days else go back 1 Third -> Sum based on range
SumGapSunday =
var __isMonday = WEEKDAY(TODAY()) = 2
var __MoveTo = if(__isMonday, TODAY()-3,TODAY()-1)
return
CALCULATE( sum(TableRol[val]), FILTER(TableRol, TableRol[Date] >= __MoveTo && TableRol[Date] < TODAY() ))
Upvotes: 1