Forum Discussion
hwoehler
Helper I
6 years agoget 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
Super User
6 years agohwoehler , can ypu let us know the logic of last column. Not very clear from the example
- hwoehler6 years ago
Helper 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 ago
Super 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 ago
Community Champion
Yep, EARLIER.