0
0
Tableaubi_tool~20 mins

Dynamic measure swap in Tableau - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Dynamic Measure Swap Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
dax_lod_result
intermediate
2:00remaining
Dynamic Measure Swap Using Parameter Selection

You have a Tableau parameter named Measure Selector with values: Sales, Profit, and Quantity. You want to create a calculated field that dynamically returns the selected measure's value.

Which of the following calculated field formulas correctly implements this dynamic measure swap?

ADNE )]ytitnauQ[(MUS ESLE )]tiforP[(MUS NEHT 'tiforP' = ]rotceleS erusaeM[ FIESLE )]selaS[(MUS NEHT 'selaS' = ]rotceleS erusaeM[ FI
BIF [Measure Selector] = 'Sales' THEN SUM([Sales]) ELSEIF [Measure Selector] = 'Profit' THEN SUM([Profit]) ELSE SUM([Quantity]) END
CIF [Measure Selector] = 'Sales' THEN [Sales] ELSEIF [Measure Selector] = 'Profit' THEN [Profit] ELSE [Quantity] END
D
CASE [Measure Selector]
WHEN 'Sales' THEN SUM([Sales])
WHEN 'Profit' THEN SUM([Profit])
WHEN 'Quantity' THEN SUM([Quantity])
END
Attempts:
2 left
💡 Hint

Remember that you need to aggregate the measures inside the calculated field to work correctly in Tableau.

visualization
intermediate
2:00remaining
Best Visualization for Dynamic Measure Swap

You have implemented a dynamic measure swap in Tableau using a parameter to switch between Sales, Profit, and Quantity. You want to create a dashboard that clearly shows the selected measure over time.

Which visualization type is best suited to display this dynamic measure swap effectively?

AA scatter plot with Sales on x-axis and Profit on y-axis
BA pie chart showing the proportion of Sales, Profit, and Quantity for the latest date
CA line chart with the date on the x-axis and the dynamic measure on the y-axis
DA stacked bar chart showing Sales, Profit, and Quantity side by side
Attempts:
2 left
💡 Hint

Think about how to best show changes over time for a single selected measure.

data_modeling
advanced
3:00remaining
Data Model Considerations for Dynamic Measure Swap

You want to implement a dynamic measure swap in Tableau that allows users to select from multiple measures stored in different fact tables (e.g., Sales fact, Inventory fact).

What is the best data modeling approach to support this dynamic measure swap efficiently?

ACreate a union of all fact tables with a measure type column and a measure value column, then use this combined table for dynamic swapping
BCreate separate calculated fields for each fact table and use multiple parameters to switch between them
CUse blending to combine the fact tables at the visualization level and swap measures using parameters
DDuplicate the data source for each fact table and swap between data sources using parameters
Attempts:
2 left
💡 Hint

Think about how to unify measures from different tables into one structure for easy swapping.

🔧 Formula Fix
advanced
3:00remaining
Debugging Incorrect Dynamic Measure Swap Output

You created a calculated field for dynamic measure swap using this formula:

IF [Measure Selector] = 'Sales' THEN [Sales]
ELSEIF [Measure Selector] = 'Profit' THEN [Profit]
ELSE [Quantity] END

When you use this field in a view aggregated by month, the values are incorrect or missing.

What is the main reason for this issue?

AThe calculated field returns row-level values without aggregation, causing aggregation errors in the view
BThe data source does not contain the Quantity field
CThe ELSEIF syntax is invalid in Tableau calculated fields
DThe parameter values do not match the strings in the calculated field
Attempts:
2 left
💡 Hint

Think about aggregation requirements when using calculated fields in aggregated views.

🧠 Conceptual
expert
4:00remaining
Scenario: Performance Impact of Dynamic Measure Swap

You have a large dataset and implemented a dynamic measure swap using a parameter and a calculated field with multiple SUM aggregations. Users report slow dashboard performance.

Which approach will most effectively improve performance while keeping the dynamic measure swap functionality?

ARemove the dynamic measure swap and create separate dashboards for each measure
BPre-aggregate the measures in the data source or extract and use those pre-aggregated fields in the dynamic measure swap calculation
CReplace the parameter with multiple filters to reduce data volume dynamically
DUse table calculations instead of aggregations in the calculated field
Attempts:
2 left
💡 Hint

Think about reducing the amount of data Tableau processes at runtime.