0
0
Power BIbi_tool~20 mins

Replace values in Power BI - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Replace Values Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
dax_lod_result
intermediate
2:00remaining
Replace values in a column using DAX
You have a column 'Status' with values 'Pending', 'In Progress', and 'Completed'. You want to create a new calculated column that replaces 'Pending' with 'Not Started' and keeps other values unchanged. Which DAX expression produces the correct result?
ANewStatus = SUBSTITUTE(Table[Status], "Pending", "Not Started")
BNewStatus = SWITCH(Table[Status], "Pending", "Not Started", Table[Status])
CNewStatus = REPLACE(Table[Status], 1, 7, "Not Started")
DNewStatus = IF(Table[Status] = "Pending", "Not Started", Table[Status])
Attempts:
2 left
💡 Hint
Use a conditional function that checks the value and replaces only when it matches.
visualization
intermediate
2:00remaining
Visualizing replaced values in a report
You replaced 'Pending' with 'Not Started' in your data model. You want to create a bar chart showing counts of each status including the replaced value. Which visualization setup is best practice?
AUse a slicer to filter only 'Pending' values and show counts.
BUse the original 'Status' column on the axis and count of rows as values.
CUse the new calculated column 'NewStatus' on the axis and count of rows as values.
DUse a pie chart with original 'Status' column and replace labels manually.
Attempts:
2 left
💡 Hint
Use the column that contains the replaced values for accurate visualization.
data_modeling
advanced
2:30remaining
Replacing multiple values in a column efficiently
You want to replace multiple values in a 'Category' column: 'A' → 'Alpha', 'B' → 'Beta', 'C' → 'Gamma'. Which DAX expression correctly creates a new column with these replacements and keeps other values unchanged?
ANewCategory = SWITCH(Table[Category], "A", "Alpha", "B", "Beta", "C", "Gamma", Table[Category])
BNewCategory = REPLACE(Table[Category], 1, 1, "Alpha")
CNewCategory = IF(Table[Category] = "A", "Alpha", IF(Table[Category] = "B", "Beta", IF(Table[Category] = "C", "Gamma", Table[Category])))
DNewCategory = SUBSTITUTE(Table[Category], "A", "Alpha")
Attempts:
2 left
💡 Hint
Use a function that handles multiple conditions with a default fallback.
🔧 Formula Fix
advanced
2:00remaining
Identify the error in this value replacement DAX
This DAX expression aims to replace 'Old' with 'New' in 'Status' column but causes an error. What is the error?
Power BI
NewStatus = IF(Table[Status] == "Old", "New", Table[Status])
ARuntime error: Table[Status] column not found.
BSyntaxError: '==' is invalid in DAX; use single '=' for comparison.
CNo error; expression works correctly.
DTypeError: Cannot compare text with '==' operator.
Attempts:
2 left
💡 Hint
Check the operator used for comparison in DAX.
🧠 Conceptual
expert
3:00remaining
Best practice for replacing values in large datasets
You have a large dataset with millions of rows. You need to replace several values in a column. Which approach is best for performance and maintainability?
ACreate a separate mapping table with old and new values and use a relationship to replace values via LOOKUPVALUE.
BUse nested IF statements in a calculated column to replace values directly.
CUse REPLACE function to substitute values by character position in the column.
DManually edit the source data file to replace values before loading.
Attempts:
2 left
💡 Hint
Consider scalability and ease of updates when choosing replacement methods.