Forum Discussion

natasha519's avatar
natasha519
Icon for Helper II rankHelper II
4 years ago
Solved

Create 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...
  • smpa01's avatar
    smpa01
    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
    )