Microsoft Certified: Power BI Data Analyst AssociatePrepare the dataHard

A data analyst is working with a large transactional dataset in Power Query. The 'TransactionAmount' column is currently of type Text and contains values like '€1,234.56', '$789.00', and '23.45'. The analyst needs to convert this column to a Decimal Number type for calculations. The challenge is that the currency symbols and comma thousands separators vary and must be removed, and the decimal separator is always a period. Which Power Query transformation, considering locale settings, is the most robust way to achieve this conversion?

  1. AChange Type to Decimal Number using 'Replace Errors' after initial conversion.
  2. BReplace Value for currency symbols and commas, then Change Type to Decimal Number.
  3. CChange Type to Decimal Number using 'en-US' locale.
  4. DChange Type to Decimal Number (default locale)
Show answer & explanation

Correct answer: C. Change Type to Decimal Number using 'en-US' locale.

Changing type with locale settings is designed precisely for this scenario. By specifying a locale like 'en-US', Power Query correctly interprets the period as the decimal separator and ignores common currency symbols and comma thousands separators, making it the most robust and efficient method without requiring multiple 'Replace Value' steps.

Why the other options are wrong

  • A. Replacing errors after an initial conversion means the conversion itself failed for some values, which is what we are trying to prevent with a robust method; it's a reactive solution, not a proactive one.
  • B. While this sequence works, it requires multiple 'Replace Value' steps for each currency symbol and comma, which is less efficient and robust than using locale settings for a common pattern.
  • D. Default locale might not correctly interpret the mixed currency symbols and comma separators, leading to errors or incorrect conversions.

Change Type With Locale

The 'Change Type With Locale' transformation in Power Query allows you to convert a column to a specific data type while explicitly defining the cultural formatting rules (locale) for numbers, dates, or times. This is crucial for correctly interpreting regional differences in decimal separators, thousands separators, and date formats.

  • Converts column to specified data type.
  • Applies specific cultural formatting rules (locale).
  • Handles regional variations in numbers and dates (e.g., '.' vs ',' for decimals).

Memory trick: Locale is the key to understanding global numbers.

More Prepare the data questions