Microsoft Certified: Power BI Data Analyst AssociatePrepare the dataEasy

A data analyst is importing a dataset into Power BI from a CSV file. The file contains a column named 'Price' where some values are missing, represented by empty strings. The analyst needs to replace these empty strings with `0` to ensure correct numeric calculations. Which Power Query transformation should the analyst use?

  1. AUnpivot Columns
  2. BFill Down
  3. CReplace Values
  4. DMerge Columns
Show answer & explanation

Correct answer: C. Replace Values

The 'Replace Values' transformation allows you to find specific values within a column and replace them with new specified values. In this case, empty strings can be replaced with 0.

Why the other options are wrong

  • A. Unpivot Columns transforms columns into attribute-value pairs, which is not relevant for replacing specific values within a column.
  • B. Fill Down propagates the last valid value downwards to fill nulls, which is not suitable for replacing specific empty strings with 0.
  • D. Merge Columns combines multiple columns into a single new column, which is unrelated to replacing missing values.

Replace Values (Power Query)

A Power Query transformation that allows you to find all occurrences of a specific value within a selected column and replace them with a new specified value.

  • Used for data cleaning and standardization.
  • Can replace text, numbers, nulls, or empty strings.
  • Case-sensitive option available for text replacement.

Memory trick: Clean data, replace what's wrong, make it strong.

More Prepare the data questions