Bird
Raised Fist0
Tableaubi_tool~20 mins

Data model best practices 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
🎖️
Data Model Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Understanding Star Schema in Tableau

Which of the following best describes a star schema data model in Tableau?

ADimension tables connected in a circular loop to the fact table.
BA central fact table connected to multiple dimension tables, resembling a star shape.
CA single large table with all data combined without relationships.
DMultiple fact tables connected directly to each other without dimension tables.
Attempts:
2 left
💡 Hint

Think about how fact and dimension tables relate in a simple, clear structure.

❓ lod_result
intermediate
2:00remaining
Calculating Total Sales with Correct Granularity

Given a sales fact table with columns OrderID, ProductID, and SalesAmount, and a product dimension table with ProductID and Category, which LOD expression correctly calculates total sales by category without double counting?

Tableau
Total Sales = SUM([Sales].[SalesAmount])
ATotal Sales by Category = { FIXED : SUM([Sales].[SalesAmount]) }
BTotal Sales by Category = { FIXED [Product].[ProductID] : SUM([Sales].[SalesAmount]) }
CTotal Sales by Category = SUM([Sales].[SalesAmount])
DTotal Sales by Category = { FIXED [Product].[Category] : SUM([Sales].[SalesAmount]) }
Attempts:
2 left
💡 Hint

Use a function that keeps the category filter but removes other filters on the product table.

❓ visualization
advanced
2:00remaining
Choosing the Best Visualization for Hierarchical Data

You have a data model with sales data by region, country, and city. Which Tableau visualization best helps users explore this hierarchy interactively?

AA treemap with drill-down capability from region to city.
BA simple bar chart showing total sales by city only.
CA pie chart showing sales by region without hierarchy.
DA scatter plot with sales on X-axis and profit on Y-axis.
Attempts:
2 left
💡 Hint

Look for a visualization that shows parts within parts and allows drilling down.

🔧 Formula Fix
advanced
2:00remaining
Fixing Relationship Cardinality Issues

You created a relationship between a customer dimension and sales fact table in Tableau, but your sales totals are unexpectedly high. What is the most likely cause?

AThe relationship cardinality is set to many-to-many instead of one-to-many.
BThe sales fact table is missing a primary key.
CThe customer dimension table has duplicate customer IDs.
DThe relationship is set to one-to-one but should be many-to-one.
Attempts:
2 left
💡 Hint

Check how many records in each table relate to the other.

🎯 Scenario
expert
3:00remaining
Optimizing Data Model Performance for Large Datasets

Your Tableau dashboard is slow because the data model has many large tables joined with complex relationships. Which approach will best improve performance while keeping data accuracy?

ARemove all relationships and use cross-database joins instead.
BLoad all data as live connections without any filters or aggregations.
CUse extract filters to reduce data volume and create aggregated tables for common queries.
DDuplicate all tables and join them multiple times to speed up queries.
Attempts:
2 left
💡 Hint

Think about reducing data size and pre-aggregating to speed up queries.

Practice

(1/5)
1. Which data model structure is recommended in Tableau for better performance and clarity?
easy
A. Randomly joined tables without keys
B. Flat table with all data combined
C. Snowflake schema with many nested joins
D. Star schema with clear fact and dimension tables

Solution

  1. Step 1: Understand common data model types

    Star schema organizes data into fact and dimension tables, simplifying relationships.
  2. Step 2: Identify best practice for Tableau

    Tableau performs best with star schema due to clear joins and simpler queries.
  3. Final Answer:

    Star schema with clear fact and dimension tables -> Option D
  4. Quick Check:

    Star schema = Best practice [OK]
Hint: Choose star schema for clear, fast Tableau models [OK]
Common Mistakes:
  • Confusing snowflake schema as better
  • Using flat tables causing slow performance
  • Ignoring relationship clarity
2. Which of the following is the correct way to define a relationship between tables in Tableau's data model?
easy
A. Using a calculated field to join unrelated columns
B. Joining tables without any common columns
C. Creating a relationship on matching key columns
D. Using multiple joins on non-key columns

Solution

  1. Step 1: Identify how relationships work in Tableau

    Relationships require matching key columns to link tables logically.
  2. Step 2: Evaluate options for correct syntax

    Only creating relationships on matching keys ensures correct data blending and filtering.
  3. Final Answer:

    Creating a relationship on matching key columns -> Option C
  4. Quick Check:

    Relationships need matching keys [OK]
Hint: Always link tables on matching keys [OK]
Common Mistakes:
  • Joining on unrelated columns
  • Using calculated fields as join keys
  • Ignoring key columns in relationships
3. Given a star schema with a fact table 'Sales' and dimension table 'Products', what happens if you join them on a non-unique column in 'Products'?
medium
A. The join filters out unmatched sales rows
B. The join duplicates sales rows, inflating totals
C. The join returns only unique sales rows
D. The join causes a syntax error in Tableau

Solution

  1. Step 1: Understand join behavior with non-unique keys

    Joining on non-unique keys duplicates fact rows for each matching dimension row.
  2. Step 2: Predict impact on sales totals

    Duplicated rows inflate aggregated sales, causing incorrect totals.
  3. Final Answer:

    The join duplicates sales rows, inflating totals -> Option B
  4. Quick Check:

    Non-unique join keys cause duplicates [OK]
Hint: Check uniqueness of join keys to avoid duplicates [OK]
Common Mistakes:
  • Assuming join filters data instead of duplicating
  • Thinking Tableau throws errors on such joins
  • Believing totals remain accurate despite duplicates
4. You created a relationship between 'Orders' and 'Customers' tables in Tableau, but your report shows incorrect totals. What is the most likely cause?
medium
A. The relationship uses non-matching key columns
B. The data source is missing required columns
C. The relationship is set as a join instead of a relationship
D. The tables have no data at all

Solution

  1. Step 1: Analyze relationship setup

    Incorrect totals often result from relationships on columns that don't match properly.
  2. Step 2: Check relationship keys

    If keys don't match, Tableau can't correctly link data, causing wrong aggregations.
  3. Final Answer:

    The relationship uses non-matching key columns -> Option A
  4. Quick Check:

    Non-matching keys cause incorrect totals [OK]
Hint: Verify keys match exactly in relationships [OK]
Common Mistakes:
  • Confusing joins with relationships
  • Ignoring missing columns
  • Assuming empty tables cause totals errors
5. You have a complex data model with multiple fact tables and dimension tables. To improve performance and clarity in Tableau, what is the best approach?
hard
A. Create a star schema by consolidating facts and linking dimensions clearly
B. Join all tables into one large flat table
C. Use multiple snowflake schemas with deep nested joins
D. Avoid relationships and use calculated fields to combine data

Solution

  1. Step 1: Assess complex data model issues

    Multiple fact tables and complex joins slow performance and confuse users.
  2. Step 2: Apply best practice for simplification

    Consolidating facts and using star schema with clear dimension links improves speed and clarity.
  3. Step 3: Avoid approaches that increase complexity

    Flat tables or snowflake schemas with deep joins reduce performance and maintainability.
  4. Final Answer:

    Create a star schema by consolidating facts and linking dimensions clearly -> Option A
  5. Quick Check:

    Star schema consolidation = Best for complex models [OK]
Hint: Simplify complex models into star schema for best results [OK]
Common Mistakes:
  • Flattening all tables causing slow queries
  • Using deep nested joins increasing complexity
  • Relying on calculated fields instead of relationships