0
0
Power BIbi_tool~10 mins

DATEADD for period shifts in Power BI - Cell-by-Cell Formula Trace

Choose your learning style9 modes available
Sample Data

This table shows daily sales data with dates in column A and sales amounts in column B.

CellValue
A1Date
A22024-01-01
A32024-01-02
A42024-01-03
B1Sales
B2100
B3150
B4200
Formula Trace
Sales_Last_Week = CALCULATE(SUM('Table'[Sales]), DATEADD('Table'[Date], -7, DAY))
Step 1: DATEADD('Table'[Date], -7, DAY)
Step 2: FILTER('Table', 'Table'[Date] IN shifted_dates)
Step 3: SUM('Table'[Sales]) over filtered rows
Cell Reference Map
Date
Sales
The formula references the Date column to shift dates by 7 days back and sums Sales for those shifted dates.
Result
    A          B               C
1 | Date     | Sales | Sales_Last_Week |
2 |2024-01-01|  100  |       0        |
3 |2024-01-02|  150  |       0        |
4 |2024-01-03|  200  |       0        |
Since the sample data only has dates starting at 2024-01-01, shifting by -7 days results in no matching dates, so Sales_Last_Week is 0 for all rows.
Sheet Trace Quiz - 3 Questions
Test your understanding
What does DATEADD('Table'[Date], -7, DAY) do in this formula?
AShifts each date 7 days earlier
BShifts each date 7 days later
CFilters dates to only the last 7 days
DReturns the original dates without change
Key Result
DATEADD shifts a date column by a specified number of intervals (days, months, years) to enable period comparisons.