Forum Discussion
Write values in column from last year
- 4 years ago
Hi dirkkoch
Use EDATE([date column], -12) function to get the same date in last year. This would not have that problem. For leap years, it will get last year's Feb 28th's value for this leap year's Feb 29th.
calculatedColumn = MAXX ( FILTER ( t1, t1[Route] = EARLIER ( t1[Route] ) && t1[Datum Auswertung] = EDATE ( EARLIER ( t1[Datum Auswertung] ), -12 ) ), t1[Anzahl Lieferungen] )Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.
calculatedColumn=MAXX(filter(t1,t1[Route]=earlier(t1[Route])&&t1[Datum Auswertung]=earlier(t1[Datum Auswertung])-365),t1[Anzahl Lieferungen])- dirkkoch4 years ago
Helper III
smpa01 thank you for the support. This works fine. Since there are also leap years with 366 days a year. How can I take care of this without having to manually adjust?
- v-jingzhang4 years ago
Community Support
Hi dirkkoch
Use EDATE([date column], -12) function to get the same date in last year. This would not have that problem. For leap years, it will get last year's Feb 28th's value for this leap year's Feb 29th.
calculatedColumn = MAXX ( FILTER ( t1, t1[Route] = EARLIER ( t1[Route] ) && t1[Datum Auswertung] = EDATE ( EARLIER ( t1[Datum Auswertung] ), -12 ) ), t1[Anzahl Lieferungen] )Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.