Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
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
The last date is
31/12/2019
Thank you
Solved! Go to Solution.
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")
)
Proud to be a Super User! |
|
Hiii @MCacc
@MCacc , Go to modelling tab and select new table and use
DAX
DateTable =
VAR StartDate = DATE(2004, 1, 1)
VAR EndDate = DATE(2019, 12, 31)
RETURN
ADDCOLUMNS (
CALENDAR (StartDate, EndDate),
"Year", YEAR([Date]),
"Month", MONTH([Date]),
"Day", DAY([Date]),
"MonthName", FORMAT([Date], "MMMM"),
"Quarter", "Q" & FORMAT([Date], "Q")
)
Proud to be a Super User! |
|
Thank you,
but is there any way I can achieve this dynamically starting from Today date?
Thank you
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")
)
Proud to be a Super User! |
|
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 38 | |
| 36 | |
| 33 | |
| 31 | |
| 28 |
| User | Count |
|---|---|
| 129 | |
| 88 | |
| 79 | |
| 68 | |
| 63 |