Anonymous
5 years agoNot applicable
Filtering last day with data
Hi,
I'm trying to build a measure that shows the data either from yesterday or the day before depending on the day of the week. Since there are no new data uploads on Sunday, I want to show the data from Saturday on Mondays. No matter what I do the measure is showing blank on Mondays.
This is how my measure looks like:
last_day_with_data =
VAR _yesterday = CALCULATE(
SUM('Table'[value]),
FILTER ('Table',
DATEVALUE ('Table'[timestamp]) = DATEVALUE(MAX('Table'[timestamp])-1)))
VAR _daybefore = CALCULATE(
SUM('Table'[value]),
FILTER ('Table',
DATEVALUE ('Table'[timestamp]) = DATEVALUE(MAX('Table'[timestamp])-2)))
VAR _monday = [weekday_measure] = "maanantai"
RETURN
IF(_monday, _daybefore, _yesterday)
Can anyone help me with this? 🙂 You can find the pbix in here.
Thank you in advance!
Jules