Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to shift the date by one month using DATEADD.
Power BI
ShiftedDate = DATEADD('Calendar'[Date], [1], MONTH)
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 0 will not shift the date.
Using -1 shifts the date backward, not forward.
✗ Incorrect
To shift the date forward by one month, use 1 as the number of intervals in DATEADD.
2fill in blank
mediumComplete the code to shift the date by three quarters backward.
Power BI
ShiftedDate = DATEADD('Calendar'[Date], [1], QUARTER)
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using positive 3 shifts forward instead of backward.
Using 1 or -1 shifts by only one quarter, not three.
✗ Incorrect
To shift the date backward by three quarters, use -3 as the number of intervals.
3fill in blank
hardFix the error in the code to correctly shift the date by one year forward.
Power BI
ShiftedDate = DATEADD('Calendar'[Date], [1], YEAR)
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Putting the interval type as the second argument.
Using a string instead of a number for the shift amount.
✗ Incorrect
The second argument must be a number, not a string or interval name.
4fill in blank
hardFill both blanks to shift the date by two weeks backward.
Power BI
ShiftedDate = DATEADD('Calendar'[Date], [1], [2])
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using positive 2 shifts forward instead of backward.
Using MONTH instead of WEEK for weekly shifts.
✗ Incorrect
Use -2 to shift backward by two intervals, and WEEK as the interval type.
5fill in blank
hardFill all three blanks to shift the date by five days forward.
Power BI
ShiftedDate = DATEADD([1], [2], [3])
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using a non-date column as the first argument.
Using negative number to shift forward.
Using MONTH or WEEK instead of DAY.
✗ Incorrect
The first argument is the date column, second is number of days to shift, third is the interval DAY.