Forum Discussion

morgancampbell's avatar
5 years ago
Solved

Offset a Column based on another column

My data is as follows:   Week Name Emails Sent 38 Person 1 134 38 Person 2 237 38 Person 3 236 37 Person 1 127 37 Person 2 345 37 Person 3 198 etc etc etc ...
  • AllisonKennedy's avatar
    5 years ago
    You should be able to add a new column:

    Last Week Emails Sent =
    MAXX(FILTER(ALL(Table), Table[Name] = EARLIER(Table[Name]) && Table[Week] -1 = EARLER(Table[Week]) ), Table[Emails Sent] )

    You may also be able to get what you want using measures, but don't know what your ultimate goal is.
  • v-deddai1-msft's avatar
    5 years ago

    Hi morgancampbell ,

     

    You can use the following calculated column:

     

    Last Week Emails Sent = CALCULATE(SUM('Table'[Emails Sent]),FILTER('Table','Table'[Week] = EARLIER('Table'[Week])-1&&'Table'[Name] = EARLIER('Table'[Name])))

     

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

     

    Best Regards,

    Dedmon Dai