Changing Data Types
Every column in Power Query has a data type, such as whole number, decimal number, date or text. Setting the types does more than format the data, because Power Query checks every value against its column’s type and flags any value that does not fit.
When a query is first created, Power Query usually adds a Changed Type step to Applied Steps on its own, with types guessed from the first rows of data. That step names each column it changes, so it is one more place where a renamed column can break the query. As a rule, the Changed Type step should:
- appear only once in a query
- come as late in the query as possible
It can be tempting to delete the step altogether, but that throws away the check. Setting types catches mistakes such as invalid dates and numbers typed in the wrong form, which are very hard to spot by any other means. The example below shows why.
Without a type check
Section titled “Without a type check”A single row of monthly operating costs arrives like this:

The source data
The row contains two mistakes:
- November has only 30 days, so 31/11/2020 is not a valid date.
- The April figure has been typed as 54,50.
Both are easy to miss, and Excel gives no clear warning about either. A typical manual check goes no further than selecting the Total cell and confirming that its formula covers the right range:

Checking only the range of the Total formula
The range is right, but the total is not. Excel stores 54,50 as text, which SUM ignores, so the total of 33,040 leaves out 5,450 and understates the year’s operating costs by about 14%.
With a type check
Section titled “With a type check”Running the same data through Power Query and setting the types brings both mistakes into view.
1. Load the data
Section titled “1. Load the data”Load the table into the Power Query Editor:

2. Unpivot the months
Section titled “2. Unpivot the months”Select the Heading column, then choose Unpivot Other Columns, which turns the month columns into rows:

The April figure already stands out, because it is aligned differently from the numbers around it.
3. Remove the total
Section titled “3. Remove the total”Filter the Attribute column to remove the Total row:

4. Set the data types
Section titled “4. Set the data types”Click the type icon at the left of each column header and choose a type from the list. Here Heading is text, Attribute is a date and Value is a decimal number:

With the types set, the editor looks like this:

The invalid date now shows as an Error. The figure 54,50 has been converted to the number 5450, because the comma is read as a thousands separator. Had it been something that could not be read as a number, it would have shown as an error too.
5. Close & Load
Section titled “5. Close & Load”Choose Close & Load to load the result to a worksheet:

Add a total row to the table on the worksheet:

The total now includes April’s 5,450, and the blank date beside November’s figure makes it plain that something is wrong with that row.
Summary
Section titled “Summary”Setting data types costs a few clicks and catches errors that a worksheet hides. Wherever the accuracy of the figures matters, keep the Changed Type step, and place it near the end of the query.