Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

MAX & Filter

Dear all, I have a table with data from different stores and also dates of these data. I now want to include a new column (lastest Data date) which contains an X if this row is the latest data for ...
  • Anonymous's avatar
    Anonymous
    6 years ago

    Hi Anonymous ,

    You can create a calculated column as below:

    Latest data Date = 
    VAR _latestDate =
        CALCULATE (
            MAX ( 'Store'[Date] ),
            FILTER ( 'Store', 'Store'[Store] = EARLIER ( 'Store'[Store] ) )
        )
    RETURN
        IF ( 'Store'[Date] = _latestDate, "X", "-" )

    Best Regards

    Rena