Bird
Raised Fist0
Power BIbi_tool~5 mins

Replace values in Power BI - Step-by-Step Guide

Choose your learning style10 modes available
Introduction
Replacing values lets you fix or clean data by changing specific entries. This helps when you have typos, wrong labels, or need to standardize data before analysis.
When your sales data has misspelled product names that need correction
When you want to change all 'N/A' entries to blank or zero for calculations
When you need to replace old region codes with new ones in your dataset
When you want to standardize different date formats into one consistent format
When you want to fix inconsistent capitalization in customer names
Steps
Step 1: Open
- Power Query Editor
The data preview window shows your table with columns and rows
Step 2: Select
- the column where you want to replace values
The column is highlighted for editing
Step 3: Click
- Home tab > Replace Values button
A Replace Values dialog box appears
Step 4: Type
- 'Value To Find' field in the dialog
The value you want to replace is entered
Step 5: Type
- 'Replace With' field in the dialog
The new value to replace with is entered
Step 6: Click
- OK button in the Replace Values dialog
All matching values in the selected column change to the new value
Step 7: Click
- Close & Apply button in Power Query Editor
The changes are saved and applied to your Power BI report
Before vs After
Before
Column 'Region' has values: 'North', 'Noth', 'South', 'East', 'West'
After
Column 'Region' has values: 'North', 'North', 'South', 'East', 'West'
Settings Reference
Value To Find
📍 Replace Values dialog box
Specifies the exact value in the column to be replaced
Default: Empty
Replace With
📍 Replace Values dialog box
Specifies the new value that will replace the old one
Default: Empty
Match entire cell contents
📍 Replace Values dialog box (checkbox)
If checked, only cells exactly matching the value are replaced; if unchecked, partial matches are replaced
Default: Unchecked
Common Mistakes
Replacing values without selecting the correct column
The replacement happens in the wrong column, causing unexpected data changes
Always select the specific column where you want to replace values before using Replace Values
Not matching the exact value due to case sensitivity or extra spaces
Values that look similar but differ in case or spaces won't be replaced
Check for exact spelling, case, and spaces in the 'Value To Find' field or clean data first
Summary
Replace Values lets you fix or standardize data entries in a selected column.
You must select the correct column before replacing values to avoid errors.
Use the 'Match entire cell contents' option to control exact or partial matching.

Practice

(1/5)
1. What is the main purpose of using Replace Values in Power BI's Power Query?
easy
A. To clean or standardize data by changing specific values
B. To create new calculated columns
C. To filter rows based on conditions
D. To merge two tables together

Solution

  1. Step 1: Understand Replace Values function

    Replace Values is used to change specific values in a column to clean or standardize data.
  2. Step 2: Compare with other options

    Creating columns, filtering rows, or merging tables are different operations not related to Replace Values.
  3. Final Answer:

    To clean or standardize data by changing specific values -> Option A
  4. Quick Check:

    Replace Values = Clean or standardize data [OK]
Hint: Replace Values changes data entries to fix or standardize them [OK]
Common Mistakes:
  • Confusing Replace Values with creating new columns
  • Thinking Replace Values filters data
  • Mixing Replace Values with merging tables
2. Which of the following is the correct syntax to replace all occurrences of "old" with "new" in the column "Status" using Table.ReplaceValue in Power Query M language?
easy
A. Table.ReplaceValue(Source, "old", "new", Replacer.ReplaceText)
B. Table.ReplaceValue(Source, "old", "new", Replacer.ReplaceValue, {"Status"})
C. Table.ReplaceValue(Source, "old", "new", Replacer.ReplaceText, "Status")
D. Table.ReplaceValue(Source, "old", "new", Replacer.ReplaceText, {"Status"})

Solution

  1. Step 1: Identify correct replacer and column list

    The correct replacer for text replacement is Replacer.ReplaceText and the columns must be passed as a list, e.g., {"Status"}.
  2. Step 2: Check syntax correctness

    Table.ReplaceValue(Source, "old", "new", Replacer.ReplaceText, {"Status"}) uses correct replacer and column list syntax. Options B, C, and D have wrong replacer or column argument format.
  3. Final Answer:

    Table.ReplaceValue(Source, "old", "new", Replacer.ReplaceText, {"Status"}) -> Option D
  4. Quick Check:

    Correct replacer and column list = Table.ReplaceValue(Source, "old", "new", Replacer.ReplaceText, {"Status"}) [OK]
Hint: Use Replacer.ReplaceText and column list in curly braces [OK]
Common Mistakes:
  • Using wrong replacer like Replacer.ReplaceValue
  • Passing column name as string instead of list
  • Omitting replacer argument
3. Given the following Power Query M code snippet:
let
  Source = Table.FromRecords({[Name="John", Age=30], [Name="john", Age=25]}),
  Replaced = Table.ReplaceValue(Source, "john", "Jonathan", Replacer.ReplaceText, {"Name"})
in
  Replaced

What will be the value in the "Name" column for the second row after replacement?
medium
A. john
B. John
C. Jonathan
D. Error

Solution

  1. Step 1: Understand case sensitivity in ReplaceValue

    Table.ReplaceValue with Replacer.ReplaceText is case sensitive by default, so "john" (lowercase) matches only exact lowercase.
  2. Step 2: Check the second row value

    The second row has "john" lowercase, so it matches and should be replaced with "Jonathan". But the first row "John" with uppercase J is not replaced.
  3. Final Answer:

    Jonathan -> Option C
  4. Quick Check:

    Case sensitive replace changes "john" to "Jonathan" [OK]
Hint: ReplaceValue is case sensitive by default [OK]
Common Mistakes:
  • Assuming replace is case insensitive
  • Expecting "John" to be replaced
  • Confusing row order
4. You wrote this Power Query M code to replace "N/A" with null in the "Score" column:
Table.ReplaceValue(Source, "N/A", null, Replacer.ReplaceText, {"Score"})

But it throws an error. What is the likely cause?
medium
A. Using Replacer.ReplaceText instead of Replacer.ReplaceValue for text replacement
B. Replacing with null is not allowed in Power Query
C. The column list should be a string, not a list
D. The source table is missing

Solution

  1. Step 1: Check replacer type for text replacement

    Replacing text values with null requires Replacer.ReplaceValue, not Replacer.ReplaceText.
  2. Step 2: Understand null replacement

    Replacing with null is valid, but replacer must match data type operation. Using wrong replacer causes error.
  3. Final Answer:

    Using Replacer.ReplaceText instead of Replacer.ReplaceValue for text replacement -> Option A
  4. Quick Check:

    Correct replacer needed for text replace [OK]
Hint: Use Replacer.ReplaceValue for null replacement, not ReplaceText [OK]
Common Mistakes:
  • Using wrong replacer for text replacement
  • Thinking null replacement is invalid
  • Passing column name as string instead of list
5. You have a table with a "Category" column containing values: "Fruit", "fruit", "FRUIT", and "Vegetable". You want to replace all variations of "fruit" (case insensitive) with "Produce" using Power Query. Which approach correctly achieves this?
hard
A. Use Table.ReplaceValue with Replacer.ReplaceText and set case insensitive option
B. Add a custom column with Text.Lower and replace "fruit" with "Produce" there
C. Use Table.ReplaceValue with Replacer.ReplaceText multiple times for each case variant
D. Use Table.ReplaceValue with Replacer.ReplaceValue ignoring case automatically

Solution

  1. Step 1: Understand case sensitivity of ReplaceValue

    Table.ReplaceValue with Replacer.ReplaceText is case sensitive and does not have a built-in case insensitive option.
  2. Step 2: Replace all case variants

    Adding a custom column with Text.Lower converts all values to lowercase, allowing a single replace of "fruit" with "Produce" in that column.
  3. Step 3: Evaluate other options

    Using multiple ReplaceValue calls is inefficient and error-prone. No case insensitive flag exists for ReplaceValue. ReplaceValue does not ignore case automatically.
  4. Final Answer:

    Add a custom column with Text.Lower and replace "fruit" with "Produce" there -> Option B
  5. Quick Check:

    Use Text.Lower in custom column for case insensitive replace [OK]
Hint: Use Text.Lower in custom column for case insensitive replace [OK]
Common Mistakes:
  • Expecting case insensitive replace by default
  • Trying to replace all cases in one call
  • Using wrong replacer or ignoring case
Recommended

Ready to prove it?

Pass the test and this pattern moves unknown strong while earning +1 Grip toward your certificate.

10 questions~5 mineasy hard