Converting Currency Formatted Text to Number in Power Query
You are importing data from a CSV file into Power BI. The file contains a column 'SalesAmount' with values like '1,234.56' and '(987.65)' for negative amounts. You need to transform this column into a decimal number. Which sequence of Power Query steps achieves this?
Quick Answer
The correct sequence -- replace the opening parenthesis with a minus sign, remove the closing parenthesis, remove the thousands-separator comma, and only then change the type to Decimal -- is the answer because each transformation has to happen in an order that keeps the string valid for the step that follows it. Accounting notation uses parentheses to represent negative values, so that has to be converted into something Power Query's numeric parser actually understands, a leading minus sign, before anything else touches the string. The closing parenthesis is just leftover punctuation at that point and needs to be stripped so it doesn't corrupt the value. The comma is a thousands separator that Power Query would otherwise misread as part of the number's structure, so it also has to be removed while the value is still text. Only once the string looks like a clean number, with a proper sign and no stray characters, does converting its data type to Decimal succeed instead of producing an error or nulling out rows. This kind of question is really testing whether you understand that Power Query's Change Type step expects a specific, clean string shape, so whenever a column mixes formatting quirks like parentheses, currency symbols, or separators, resolve every non-numeric character first and treat the type conversion as the final step, not an earlier one.
⚠ Common exam trap
The trap here is that candidates often try to change the data type too early, before cleaning the string, or they forget to remove the closing parenthesis after replacing the opening one, leading to conversion errors.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Replace Values ('(' with '-'), Replace Values (')' with ''), Replace Values (',' with ''), then Change Type to Decimal
It first replaces the opening parenthesis '(' with a minus sign '-', then removes the closing parenthesis ')', then removes the comma thousands separator ',', and finally changes the data type to Decimal. This sequence ensures that the negative indicator is properly placed before the numeric value and that the string is cleanly formatted for type conversion.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Change Type to Decimal, then Replace Values (',' with ''), then Replace Values ('(' with '-')
Why it's wrong here
Changing type before cleaning will cause errors.
- ✗
Replace Values (',' with ''), then Replace Values ('(' with '-'), then Replace Values (')' with ''), then Change Type to Decimal
Why it's wrong here
Replacing commas before parentheses may still leave negative sign issue.
- ✗
Replace Values (',' with ''), Change Type to Decimal, then Replace Values ('(' with '-')
Why it's wrong here
Type conversion before handling parentheses fails.
- ✓
Replace Values ('(' with '-'), Replace Values (')' with ''), Replace Values (',' with ''), then Change Type to Decimal
Why this is correct
Correct order: handle negative sign first, then remove comma, then type conversion.
Go deeper
Related to this question
About these practice questions
One of 217 original PL-300 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →
Same concept, more angles
2 more ways this is tested on PL-300
These questions test the same concept from different angles. Work through them to make sure you can recognise it however the exam phrases it.
Variation 1. You are importing data from a CSV file into Power BI. The file contains a column 'SalesAmount' with values like '$1,234.56'. When you load the data, the column is detected as text. What is the most efficient way to convert this column to a numeric type in Power Query?
easy- ✓ A.Use 'Replace Values' to remove the dollar sign and comma, then change the column type to decimal.
- B.Use 'Detect Data Type' and hope it automatically converts.
- C.Change the column type to decimal directly and ignore errors.
- D.Split the column by delimiter ',' and then convert the first part.
Why A: It directly addresses the root cause: the dollar sign and comma are non-numeric characters that prevent automatic type conversion. By using 'Replace Values' to remove these characters first, you clean the data so that Power Query can then safely change the column type to decimal. This is the most efficient approach because it avoids error rows and preserves data integrity.
Variation 2. You are importing data from a CSV file into Power BI. The file contains a column 'Price' with values like '$1,234.56'. When you preview the data, the column is recognized as text. You need to convert it to a decimal number. What should you do in Power Query Editor?
easy- ✓ A.Replace values: remove '$' and ',' then change type to Decimal Number.
- B.Split the column by delimiter and keep the numeric part.
- C.Change the data type to Decimal Number directly.
- D.Remove commas using Replace Values, then change type.
Why A: Power Query Editor cannot automatically parse currency-formatted text like '$1,234.56' into a decimal number due to the non-numeric characters. By first using Replace Values to remove the '$' and ',' symbols, you strip the text down to '1234.56', which Power Query can then successfully convert to a Decimal Number type using the Change Type step.
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This PL-300 practice question is part of Courseiva's free Microsoft certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the PL-300 exam.