Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Help getting latest date for earlier value

I have a table containing Dates when Responsibility gets set, see below.   This Responsibility Set Date produces very close to what I'm trying to achieve: I want to capture the CreateDate any time ...
  • tamerj1's avatar
    3 years ago

    Hi Anonymous 
    First create a calculated column as follows

    Index2 =
    LOA_Logs[Index per LOA]
        - RANKX (
            CALCULATETABLE (
                LOA_Logs,
                ALLEXCEPT ( LOA_Logs, LOA_Logs[LOA_UID], LOA_Logs[Responsibility] )
            ),
            LOA_Logs[Index per LOA],
            ,
            ASC,
            DENSE
        )

    The the following can be either a measure or a calculated column

    Responsibility Set Date =
    MINX (
        CALCULATETABLE (
            LOA_Logs,
            ALLEXCEPT ( LOA_Logs, LOA_Logs[LOA_UID], LOA_Logs[Index2] )
        ),
        LOA_Logs[CreateDate]
    )