Bird
Raised Fist0
Tableaubi_tool~20 mins

Trend analysis in Tableau - Practice Problems & Coding Challenges

Choose your learning style10 modes available

Start learning this pattern below

Jump into concepts and practice - no test required

or
Recommended
Test this pattern10 questions across easy, medium, and hard to know if this pattern is strong
Challenge - 5 Problems
🎖️
Trend Analysis Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ dax_lod_result
intermediate
2:00remaining
Calculate Year-over-Year Sales Growth Using LOD Expression

You have a sales dataset with fields OrderDate and SalesAmount. You want to calculate the year-over-year sales growth percentage using a Level of Detail (LOD) expression in Tableau.

Which of the following LOD expressions correctly calculates the total sales for the previous year to use in the growth calculation?

A{ FIXED YEAR([OrderDate]) - 1 : SUM([SalesAmount]) }
B{ FIXED YEAR(DATEADD('year', -1, [OrderDate])) : SUM([SalesAmount]) }
C{ FIXED DATEPART('year', DATEADD('year', -1, [OrderDate])) : SUM([SalesAmount]) }
D{ FIXED YEAR([OrderDate]) : SUM([SalesAmount]) }
Attempts:
2 left
💡 Hint

Think about how to fix the year to the previous year using date functions inside the LOD.

❓ visualization
intermediate
2:00remaining
Best Visualization for Showing Monthly Sales Trend with Forecast

You want to create a dashboard that shows monthly sales trends over the past two years and includes a forecast for the next 6 months.

Which visualization type in Tableau best fits this requirement?

ALine chart with a continuous date axis and built-in Tableau forecast enabled
BBar chart grouped by month with color encoding for forecasted months
CPie chart showing sales distribution by month with forecast slice
DScatter plot with sales on Y-axis and month number on X-axis
Attempts:
2 left
💡 Hint

Consider which chart type best shows trends over time and supports forecasting.

🧠 Conceptual
advanced
2:00remaining
Understanding Moving Average for Trend Smoothing

Why is a moving average commonly used in trend analysis dashboards?

ATo replace missing data points with average values
BTo remove seasonal fluctuations and highlight the underlying trend
CTo increase the number of data points for better granularity
DTo convert categorical data into numerical data
Attempts:
2 left
💡 Hint

Think about what moving averages do to noisy data.

❓ data_modeling
advanced
2:00remaining
Designing Data Model for Multi-Year Trend Analysis

You need to build a data model in Tableau to analyze sales trends over multiple years with the ability to filter by product categories and regions.

Which data modeling approach is best to support fast and flexible trend analysis?

AOnly a fact table with no dimension tables, using calculated fields for categories
BSingle flat table with all sales, product, region, and date columns combined
CSeparate tables for each year with no shared dimension tables
DStar schema with a fact sales table linked to dimension tables for date, product, and region
Attempts:
2 left
💡 Hint

Think about how dimension tables help with filtering and performance.

🔧 Formula Fix
expert
2:00remaining
Identify the Error in Trend Line Calculation

A Tableau user created a calculated field to compute a 3-month moving average of sales:

WINDOW_AVG(SUM([SalesAmount]), -2, 0)

However, the moving average does not appear correctly on the dashboard.

What is the most likely cause of the problem?

AThe calculation does not specify the correct addressing and partitioning, causing incorrect windowing
BWINDOW_AVG cannot be used with SUM aggregation inside it
CThe window frame should be from 0 to 2 instead of -2 to 0
DThe calculation needs to use RUNNING_AVG instead of WINDOW_AVG
Attempts:
2 left
💡 Hint

Consider how Tableau computes table calculations and the importance of addressing.

Practice

(1/5)
1. What is the main purpose of trend analysis in Tableau?
easy
A. To create pie charts for categories
B. To show how data changes over time
C. To filter data by region
D. To sort data alphabetically

Solution

  1. Step 1: Understand trend analysis concept

    Trend analysis focuses on observing data changes over a period of time.
  2. Step 2: Identify the correct purpose

    Among the options, only showing data changes over time matches trend analysis.
  3. Final Answer:

    To show how data changes over time -> Option B
  4. Quick Check:

    Trend analysis = show data changes over time [OK]
Hint: Trend analysis = data changes over time [OK]
Common Mistakes:
  • Confusing trend analysis with filtering or sorting
  • Thinking trend analysis creates pie charts
  • Assuming trend analysis is about categories only
2. Which of the following is the correct way to add a trend line in Tableau?
easy
A. Drag a date field to Columns, measure to Rows, then add trend line from Analytics pane
B. Drag a measure to Filters, then add trend line from Data pane
C. Drag a dimension to Rows, then add trend line from Marks card
D. Drag a date field to Filters, then add trend line from Format pane

Solution

  1. Step 1: Understand how to create trend charts

    Trend charts require date on Columns and measure on Rows to show data over time.
  2. Step 2: Identify how to add trend lines

    Trend lines are added from the Analytics pane, not Data, Marks, or Format panes.
  3. Final Answer:

    Drag a date field to Columns, measure to Rows, then add trend line from Analytics pane -> Option A
  4. Quick Check:

    Date on Columns + measure on Rows + Analytics pane = trend line [OK]
Hint: Date on Columns + measure on Rows + Analytics pane [OK]
Common Mistakes:
  • Trying to add trend line from wrong pane
  • Placing date field in Filters instead of Columns
  • Adding trend line without proper chart setup
3. Given a line chart with Sales on Rows and Order Date (year) on Columns, what does adding a linear trend line show?
medium
A. The average sales value across all years
B. The sales distribution by product category
C. The total sales for each year
D. The direction and strength of sales change over years

Solution

  1. Step 1: Understand what a linear trend line represents

    A linear trend line shows the overall direction (up/down) and strength of change in data over time.
  2. Step 2: Apply this to sales over years

    It does not show averages or totals directly, but the pattern of sales increase or decrease over years.
  3. Final Answer:

    The direction and strength of sales change over years -> Option D
  4. Quick Check:

    Linear trend line = direction and strength of change [OK]
Hint: Trend line shows direction and strength of change [OK]
Common Mistakes:
  • Confusing trend line with average or total values
  • Thinking trend line shows category distribution
  • Ignoring that trend line summarizes pattern over time
4. You created a trend chart but the trend line does not appear. What is the most likely reason?
medium
A. The trend line option is disabled in Tableau settings
B. The measure is placed on Filters instead of Rows
C. The date field is not continuous (green) on Columns
D. The data source has no date field

Solution

  1. Step 1: Check date field type on Columns

    Trend lines require a continuous date field (green pill) on Columns to show smooth trends.
  2. Step 2: Understand why trend line might not appear

    If the date is discrete (blue pill), Tableau treats it as categories, so trend line cannot be drawn.
  3. Final Answer:

    The date field is not continuous (green) on Columns -> Option C
  4. Quick Check:

    Continuous date needed for trend line [OK]
Hint: Use continuous (green) date on Columns for trend lines [OK]
Common Mistakes:
  • Placing measure on Filters instead of Rows
  • Assuming trend line option is disabled by default
  • Ignoring the date field type requirement
5. You want to analyze monthly sales trends for two product categories side by side. Which setup in Tableau best achieves this?
hard
A. Place Order Date (month) on Columns, Sales on Rows, and Category on Color; add trend lines
B. Place Category on Columns, Sales on Rows, and Order Date (month) on Filters; add trend lines
C. Place Sales on Columns, Order Date (month) on Rows, and Category on Filters; add trend lines
D. Place Order Date (month) on Rows, Category on Rows, and Sales on Filters; add trend lines

Solution

  1. Step 1: Arrange date and measure for trend analysis

    Order Date (month) should be on Columns (continuous) and Sales on Rows to show trends over time.
  2. Step 2: Use Category on Color to compare categories side by side

    Placing Category on Color differentiates lines for each category in the same chart.
  3. Step 3: Add trend lines from Analytics pane

    This setup allows clear monthly trends for each category with trend lines visible.
  4. Final Answer:

    Place Order Date (month) on Columns, Sales on Rows, and Category on Color; add trend lines -> Option A
  5. Quick Check:

    Date on Columns + Sales on Rows + Category on Color = side-by-side trends [OK]
Hint: Date on Columns, Sales on Rows, Category on Color for side-by-side trends [OK]
Common Mistakes:
  • Putting Category on Filters hides categories from view
  • Placing Sales on Columns breaks trend line logic
  • Using Filters for date removes timeline context