Forum Discussion
MCacc
2 years agoHelper IV
Build calendar using year
Hello, I'm trying to build a calendar where the min date starts 20 years ago from this year, and max date is 5 years ago from this year. So because I'm 2024: The first date is: 01/01/2004 ...
- 2 years ago
CalendarTable =
VAR MinDate = DATE(YEAR(TODAY()) - 20, 1, 1)
VAR MaxDate = DATE(YEAR(TODAY()) - 5, 12, 31)
RETURN
ADDCOLUMNS (
CALENDAR (MinDate, MaxDate),
"Year", YEAR([Date]),
"Month", MONTH([Date]),
"Day", DAY([Date]),
"MonthName", FORMAT([Date], "MMMM"),
"Quarter", "Q" & FORMAT([Date], "Q")
)
MCacc
2 years agoHelper IV
Thank you,
but is there any way I can achieve this dynamically starting from Today date?
Thank you
bhanu_gautam
2 years agoSuper User
CalendarTable =
VAR MinDate = DATE(YEAR(TODAY()) - 20, 1, 1)
VAR MaxDate = DATE(YEAR(TODAY()) - 5, 12, 31)
RETURN
ADDCOLUMNS (
CALENDAR (MinDate, MaxDate),
"Year", YEAR([Date]),
"Month", MONTH([Date]),
"Day", DAY([Date]),
"MonthName", FORMAT([Date], "MMMM"),
"Quarter", "Q" & FORMAT([Date], "Q")
)