0
0
Tableaubi_tool~20 mins

Date calculations (DATEDIFF, DATEADD) in Tableau - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Date Calculation Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
dax_lod_result
intermediate
2:00remaining
Calculate days difference between two dates

Given two dates, Order Date as 2024-01-10 and Ship Date as 2024-01-15, what is the result of the following Tableau calculation?

DATEDIFF('day', [Order Date], [Ship Date])
A5
B6
C4
DError: Invalid function usage
Attempts:
2 left
💡 Hint

DATEDIFF counts the number of day boundaries crossed from the first date to the second.

dax_lod_result
intermediate
2:00remaining
Add months to a date using DATEADD

What is the result of this Tableau calculation if Order Date is 2024-03-31?

DATEADD('month', 1, [Order Date])
AError: Invalid date
B2024-04-31
C2024-05-01
D2024-04-30
Attempts:
2 left
💡 Hint

Adding one month to March 31 adjusts to the last valid day of April.

visualization
advanced
2:00remaining
Best visualization for monthly sales growth

You want to show the month-over-month sales growth percentage for the last 12 months. Which visualization type is best to clearly show this trend?

ABar chart with total sales per month
BPie chart showing sales distribution by month
CLine chart with months on the x-axis and growth % on the y-axis
DScatter plot with sales vs. months
Attempts:
2 left
💡 Hint

Trends over time are best shown with continuous lines.

dax_lod_result
advanced
2:00remaining
Calculate quarter difference between two dates

You have Start Date as 2023-11-15 and End Date as 2024-05-10. Using Tableau's DATEDIFF function, what is the quarter difference?

DATEDIFF('quarter', [Start Date], [End Date])
A2
B3
C1
D4
Attempts:
2 left
💡 Hint

Count how many quarter boundaries are crossed from start to end date.

🔧 Formula Fix
expert
2:00remaining
Identify error in date calculation formula

Which option will cause an error when calculating the difference in days between two dates in Tableau?

DATEDIFF('day', [Date1], [Date2])

Assume Date1 and Date2 are fields in the data.

A[Date1] and [Date2] are both valid date fields with no nulls
B[Date1] is a string field with date text, [Date2] is a date field
C[Date1] and [Date2] are both date fields but some values are null
D[Date1] is a date field, [Date2] is a datetime field
Attempts:
2 left
💡 Hint

DATEDIFF requires both inputs to be date or datetime types.