Forum Discussion
Create a date table from scratch
Hello,
Thank you for this great community. I'm having trouble creating a data table from scratch. Is the correct step is to:
1. Creat a new table
Then, click edit
Then, I'm not sure how to create the list of dates using List.Dates from this step. Any guidance would be great. Thank you!
Hi ale259 - you are using "Enter Data" to create a date table . not a good approach. Instead, you should use Power Query or DAX to generate a proper date table dynamically.
it looks as like below image:
DateTable = ADDCOLUMNS(
CALENDAR(DATE(2023,1,1), DATE(2025,12,31)),
"Year", YEAR([Date]),
"Month", FORMAT([Date], "MMMM"),
"MonthNumber", MONTH([Date]),
"Quarter", "Q" & FORMAT([Date], "Q")
)paste the above logic to create a date table.
Hope this helps.
2 Replies
- rajendraongole1Super User
Hi ale259 - you are using "Enter Data" to create a date table . not a good approach. Instead, you should use Power Query or DAX to generate a proper date table dynamically.
it looks as like below image:
DateTable = ADDCOLUMNS(
CALENDAR(DATE(2023,1,1), DATE(2025,12,31)),
"Year", YEAR([Date]),
"Month", FORMAT([Date], "MMMM"),
"MonthNumber", MONTH([Date]),
"Quarter", "Q" & FORMAT([Date], "Q")
)paste the above logic to create a date table.
Hope this helps.
- ale259Helper I
This is great! Thank you so much!