Forum Discussion
Malinpetersson
6 years agoRegular Visitor
Yesterday or day before
Hi! I need a mesure that brings the value back if ther is a value yesterday and if not it will bring the value from the day before yesterday, or before that day, last year. The value I am looking...
v-frfei-msft
6 years agoCommunity Support
Hi Malinpetersson ,
Does that meet your requirement?
Measure =
VAR cd =
MAX ( 'Table'[Date] )
VAR previousdate =
CALCULATE (
MAX ( 'Table'[Date] ),
FILTER ( ALLSELECTED ( 'Table' ), 'Table'[Date] < cd )
)
RETURN
CALCULATE (
SUM ( 'Table'[value] ),
FILTER ( ALLSELECTED ( 'Table' ), 'Table'[Date] = previousdate )
)
Pbix as attached.