Forum Discussion

Pierre_B's avatar
Pierre_B
New Member
3 years ago
Solved

Create a max date measure for each id

Hi everyone,   I would like to create a measure using dax in order to get the max date for each id and filtered date, and keeping the every date in my table.   date id max date 01/01/2022...
  • Barthel's avatar
    Barthel
    3 years ago

    Pierre_B,

    Try using a variable. For me that seems to do the trick.  

     

     

    max date = 
    VAR _dates =
        ALLSELECTED ( 'Table'[date] )
    VAR _result =
        CALCULATE (
            MAX ( 'table'[date] ),
            REMOVEFILTERS ( 'Table' ),
            VALUES ( 'Table'[id] ),
            _dates
        )
    RETURN
        _result