0
0
Tableaubi_tool~20 mins

Date hierarchy (year, quarter, month, day) in Tableau - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Date Hierarchy Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
dax_lod_result
intermediate
2:00remaining
Calculate Total Sales for the Current Quarter

You have a sales dataset with a date field. Using a date hierarchy (year, quarter, month, day), which DAX expression correctly calculates the total sales for the current quarter?

ACALCULATE(SUM(Sales[Amount]), FILTER(ALL('Date'), 'Date'[Quarter] = QUARTER(TODAY()) && 'Date'[Year] = YEAR(TODAY())))
BSUM(Sales[Amount]) WHERE 'Date'[Quarter] = QUARTER(TODAY())
CSUMX(FILTER(Sales, QUARTER(Sales[Date]) = QUARTER(TODAY())), Sales[Amount])
DCALCULATE(SUM(Sales[Amount]), 'Date'[Quarter] = QUARTER(TODAY()) && 'Date'[Year] = YEAR(TODAY()))
Attempts:
2 left
💡 Hint

Remember to use CALCULATE with FILTER and ALL to remove filters on the date table.

visualization
intermediate
1:30remaining
Best Visualization for Showing Sales Trend by Date Hierarchy

You want to show sales trends over time using a date hierarchy (year, quarter, month, day). Which Tableau visualization type is best suited for this purpose?

APie chart showing sales by year
BLine chart with date hierarchy on the x-axis
CBar chart with sales by product category
DScatter plot with sales amount vs. product price
Attempts:
2 left
💡 Hint

Think about how to show changes over time clearly.

data_modeling
advanced
2:30remaining
Designing a Date Dimension Table for Hierarchy

Which of the following is the best practice when designing a date dimension table to support a date hierarchy (year, quarter, month, day) in a BI model?

AUse a single integer column representing the date as YYYYMMDD without separate hierarchy columns
BStore only the full date as a string and parse it in visuals
CExclude the date dimension and use transaction dates directly in fact tables
DInclude separate columns for Year, Quarter, Month, and Day with proper data types and relationships
Attempts:
2 left
💡 Hint

Think about how hierarchies work in BI tools.

🎯 Scenario
advanced
2:30remaining
Troubleshooting Date Hierarchy Drill-Down Issue

A user reports that when drilling down from year to quarter in a Tableau dashboard, the quarters do not display correctly and some months are missing. What is the most likely cause?

AThe date hierarchy is set to use fiscal quarters instead of calendar quarters
BThe dashboard filter is set to exclude quarters
CThe date field is not recognized as a date data type in Tableau
DThe sales data has missing values for some months
Attempts:
2 left
💡 Hint

Check the data type of the date field in Tableau.

🔧 Formula Fix
expert
3:00remaining
Identify the Error in Date Hierarchy Calculation

Given the following DAX measure to calculate sales for the current month in a date hierarchy, what error will occur?

CurrentMonthSales = CALCULATE(SUM(Sales[Amount]), FILTER(ALL('Date'), 'Date'[Month] = MONTH(TODAY())))
Tableau
CurrentMonthSales = CALCULATE(SUM(Sales[Amount]), FILTER(ALL('Date'), 'Date'[Month] = MONTH(TODAY())))
AThe measure will return sales for all years in the current month, not just the current year
BSyntax error due to missing YEAR filter
CType error because MONTH() cannot be used in FILTER
DThe measure will return zero because ALL('Date') removes all filters
Attempts:
2 left
💡 Hint

Consider what happens when filtering only by month number without year.