Forum Discussion
natasha519
Helper II
4 years agoCreate Measure with LatestDate Minus 1 Year
I have a column called 'Date' and it has dates all the way till April 2021. I then created a measure called 'Latest Date' with the following formula: LatestDate = VAR LatestDate = CALCULATE(MAX(Tab...
- 4 years ago
natasha519 do you mean this, pbix is attached
forTOPN = IF ( 'Table'[Date] = CALCULATE ( MAX ( 'Table'[Date] ), ALL ( 'Table' ) ) || 'Table'[Date] = CALCULATE ( MAX ( 'Table'[Date] ), ALL ( 'Table' ) ) - 365, 1, 0 )
natasha519
Helper II
4 years agoI tried this:
LastYear =
VAR LatestDate = CALCULATE(MAX(Provisional_Data[Date]), ALL(Provisional_Data))
RETURN IF (MIN(Provisional_Data[Date]) = LatestDate-365,1,0)
But this only gives me a 1 for April 2020. I now want a 1 in BOTH April 2020 and where the LatestDate =1 so I can use Top N