Forum Discussion

alexei7's avatar
alexei7
Continued Contributor
7 years ago
Solved

DAX help

Hi guys,   I'm trying to create a DAX measure and hoping someone can help.   As a sample of some dummy date, my data is structured like this:   ReportDate ProductCode Store Status Concat...
  • v-yulgu-msft's avatar
    v-yulgu-msft
    7 years ago

    Hi alexei7,

     

    That case, please add a [Rank] column first.

    Rank =
    RANKX ( Products, Products[ReportDate],, ASC, DENSE )

    Then, modify the formula in original post as below:

    Column1 =
    VAR previousstatus =
        LOOKUPVALUE (
            Products[Status],
            Products[ProductCode], Products[ProductCode],
            Products[Store], Products[Store],
            Products[Rank], Products[Rank] - 1
        )
    RETURN
        IF ( previousstatus = BLANK () || previousstatus = "Not Live", "New", BLANK () )

    Best regards,

    Yuliana Gu