Forum Discussion
hwoehler
6 years agoHelper I
get previous values per group
Hello everybody, I would like to have the previous values (see screenshot) displayed for the "ChangeWeek" column. So there should be a new column (see screenshot "new"), where the previous value p...
- 6 years ago
Try , as new columns
Column = maxx(filter('Table','Table'[ISIN]=EARLIER('Table'[ISIN]) && not(ISBLANK('Table'[ChangeWeek])) && 'Table'[Date]<EARLIER('Table'[Date])),'Table'[Date]) Column 2 = if(ISBLANK('Table'[ChangeWeek]),BLANK(),maxx(FILTER('Table','Table'[ISIN]=EARLIER('Table'[ISIN]) && ('Table'[Date])=EARLIER('Table'[Column])),('Table'[ChangeWeek])))
amitchandak
6 years agoSuper User
hwoehler , can ypu let us know the logic of last column. Not very clear from the example
hwoehler
6 years agoHelper I
Hi amitchandak ,
you're right. The screenshot is misleading. This screenshot should be better:
desired column "new"The column "new" consists of (always) the previous value. (based on column "ChangeWeek".
Best regards, hwoehler
- amitchandak6 years agoSuper User
Try , as new columns
Column = maxx(filter('Table','Table'[ISIN]=EARLIER('Table'[ISIN]) && not(ISBLANK('Table'[ChangeWeek])) && 'Table'[Date]<EARLIER('Table'[Date])),'Table'[Date]) Column 2 = if(ISBLANK('Table'[ChangeWeek]),BLANK(),maxx(FILTER('Table','Table'[ISIN]=EARLIER('Table'[ISIN]) && ('Table'[Date])=EARLIER('Table'[Column])),('Table'[ChangeWeek])))- Greg_Deckler6 years agoCommunity Champion
Yep, EARLIER.