0
0
Power BIbi_tool~10 mins

Date table creation in Power BI - Cell-by-Cell Formula Trace

Choose your learning style9 modes available
Sample Data

This is a simple date table showing dates from January 1 to January 4, 2024, with columns for Year, Month, and Day extracted from the Date.

CellValue
A1Date
A22024-01-01
A32024-01-02
A42024-01-03
A52024-01-04
B1Year
B22024
B32024
B42024
B52024
C1Month
C2January
C3January
C4January
C5January
D1Day
D21
D32
D43
D54
Formula Trace
DateTable = ADDCOLUMNS(CALENDAR(DATE(2024,1,1), DATE(2024,1,4)), "Year", YEAR([Date]), "Month", FORMAT([Date], "MMMM"), "Day", DAY([Date]))
Step 1: CALENDAR(DATE(2024,1,1), DATE(2024,1,4))
Step 2: ADDCOLUMNS(..., "Year", YEAR([Date]))
Step 3: ADDCOLUMNS(..., "Month", FORMAT([Date], "MMMM"))
Step 4: ADDCOLUMNS(..., "Day", DAY([Date]))
Step 5: Final DateTable
Cell Reference Map
    A        B       C        D
1 | Date   | Year  | Month  | Day  |
2 | 2024-01-01 | 2024 | January | 1   |
3 | 2024-01-02 | 2024 | January | 2   |
4 | 2024-01-03 | 2024 | January | 3   |
5 | 2024-01-04 | 2024 | January | 4   |
The formula uses the Date column as the base and extracts Year, Month, and Day from it to fill columns B, C, and D.
Result
    A        | B    | C       | D
-----------------------------------
1 | Date     | Year | Month   | Day
2 | 2024-01-01 | 2024 | January | 1
3 | 2024-01-02 | 2024 | January | 2
4 | 2024-01-03 | 2024 | January | 3
5 | 2024-01-04 | 2024 | January | 4
The final date table shows each date with its corresponding year, month name, and day number in separate columns.
Sheet Trace Quiz - 3 Questions
Test your understanding
What does the CALENDAR function do in this formula?
AFormats the month name
BCreates a list of dates between two given dates
CCalculates the year from a date
DExtracts the day number
Key Result
ADDCOLUMNS adds calculated columns (Year, Month, Day) to a date range generated by CALENDAR.