0
0
Tableaubi_tool~20 mins

Difference and percent difference in Tableau - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Master of Difference and Percent Difference
Get all challenges correct to earn this badge!
Test your skills under time pressure!
dax_lod_result
intermediate
2:00remaining
Calculate Difference Between Sales of Two Years

You have a sales dataset with yearly sales. You want to calculate the difference in sales between 2023 and 2022 using a calculated field in Tableau.

Which formula correctly calculates the difference?

ASUM([Sales]) - PREVIOUS_VALUE(SUM([Sales]))
BSUM([Sales]) - LOOKUP(SUM([Sales]), -1)
CSUM(IF [Year] = 2023 THEN [Sales] ELSE 0 END) - SUM(IF [Year] = 2022 THEN [Sales] ELSE 0 END)
DSUM([Sales]) - SUM(IF [Year] = 2021 THEN [Sales] ELSE 0 END)
Attempts:
2 left
💡 Hint

Think about filtering sales for each year explicitly before subtracting.

visualization
intermediate
2:00remaining
Best Visualization for Percent Difference Over Time

You want to show the percent difference in monthly sales compared to the previous month over one year.

Which visualization type best shows this percent difference clearly?

APie chart showing percent difference for each month
BScatter plot with sales on x-axis and months on y-axis
CBar chart with total sales per month
DLine chart with percent difference as the y-axis and months on the x-axis
Attempts:
2 left
💡 Hint

Think about how to show change over time clearly.

🧠 Conceptual
advanced
2:00remaining
Understanding Percent Difference Calculation

Which formula correctly calculates the percent difference between current sales and previous sales?

A((Current Sales - Previous Sales) / Previous Sales) * 100
B((Previous Sales - Current Sales) / Current Sales) * 100
C((Current Sales + Previous Sales) / Previous Sales) * 100
D(Current Sales / Previous Sales) * 100
Attempts:
2 left
💡 Hint

Percent difference shows how much current value changed compared to previous value.

🔧 Formula Fix
advanced
2:00remaining
Identify the Error in Percent Difference Calculation

Given this Tableau calculated field for percent difference:

 (SUM([Sales]) - LOOKUP(SUM([Sales]), 1)) / LOOKUP(SUM([Sales]), 1) * 100 

What error will this cause?

AIt causes division by zero error when next month sales are zero
BIt compares current month sales to the next month instead of previous month
CIt returns percent difference correctly with no error
DIt causes syntax error due to missing parentheses
Attempts:
2 left
💡 Hint

Look at the offset number in the LOOKUP function.

🎯 Scenario
expert
3:00remaining
Create a Dashboard Showing Both Difference and Percent Difference

You have monthly sales data for two years. You want a dashboard that shows:

  • Absolute difference in sales month over month
  • Percent difference in sales month over month

Which combination of Tableau features will best achieve this?

AUse two calculated fields: one for difference using LOOKUP(SUM([Sales]), 0) - LOOKUP(SUM([Sales]), -1), and one for percent difference using ((LOOKUP(SUM([Sales]), 0) - LOOKUP(SUM([Sales]), -1)) / LOOKUP(SUM([Sales]), -1)) * 100; then show both in a dual-axis line chart with clear labels.
BCreate one calculated field for difference and use quick table calculation for percent difference; display both as separate pie charts.
CUse only percent difference quick table calculation and show it in a bar chart; omit absolute difference to avoid clutter.
DCreate calculated fields for difference and percent difference but show only difference in a scatter plot to highlight changes.
Attempts:
2 left
💡 Hint

Think about how to calculate both metrics and display them clearly together.