Bird
0
0

Given this Power Query M code:

medium📝 dax lod result Q4 of 15
Power BI - Power Query Editor
Given this Power Query M code:
let
  Source = Table.FromRecords({[Name="Anna", City="NY"],[Name="Bob", City="LA"]}),
  Replaced = Table.ReplaceValue(Source, "LA", "Los Angeles", Replacer.ReplaceText, {"City"})
in
  Replaced

What will be the value in the City column for Bob after this code runs?
ALA
BNY
CLos Angeles
Dnull
Step-by-Step Solution
Solution:
  1. Step 1: Understand the ReplaceValue function in the code

    The code replaces "LA" with "Los Angeles" in the City column.
  2. Step 2: Check Bob's City value before and after replacement

    Bob's City is "LA", so it will be replaced with "Los Angeles".
  3. Final Answer:

    Los Angeles -> Option C
  4. Quick Check:

    ReplaceValue changes "LA" to "Los Angeles" [OK]
Quick Trick: ReplaceValue changes matching values only in specified columns [OK]
Common Mistakes:
  • Assuming no change happens
  • Confusing column names
  • Thinking replacement affects other columns

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Power BI Quizzes