Forum Discussion

heidibb's avatar
heidibb
Icon for Helper IV rankHelper IV
9 years ago
Solved

Create column with Earlier value from another row

Hello,   I have a data table similar to this (the first three columns). I would like to create a column that pulls in the previous week's date. I think from my research I should use the EARLIER fun...
  • v-ljerr-msft's avatar
    9 years ago

    Hi heidibb,

     

    If I understand you correctly, you should be able to use the formula below to create a column that pulls in the previous week's date in your scenario. :smileyhappy:

    Previous Week Date = 
    CALCULATE (
        MAX ( Table1[Date] ),
        FILTER (
            ALL ( Table1 ),
            Table1[ID] = EARLIER ( Table1[ID] )
                && Table1[Week]
                    = EARLIER ( Table1[Week] ) - 1
        )
    )

     

    Regards