Power Query: Round to 2 Decimal Places
In this article
To round a number column to two decimal places in Power Query, use the Number.Round function with the second argument set to 2. You can do this either by editing the M code directly in the formula bar or by using the Round button on the Transform tab after selecting the column. The result is a numeric value rounded to two decimal places, not a text string, so it can still be used in calculations.
What You'll Need
- Power Query Editor open in Excel, Power BI Desktop, or another supported host. The steps below use the Excel and Power BI desktop interfaces; labels can differ slightly by version, device, or region.
- A table or query loaded into Power Query with at least one numeric column.
- Basic familiarity with the formula bar and the Applied Steps pane.
Step-by-Step
- Open the Power Query Editor. In Excel, select a cell in your data and go to Data > From Table/Range. In Power BI Desktop, use Home > Transform data. The Power Query Editor window opens.
- Select the numeric column you want to round. Click the column header in the data preview. If the column contains mixed types, first set the data type to Decimal Number or Whole Number using the icon in the column header.
- Use the Round button (quick method). With the column selected, go to the Transform tab and click Round. This applies rounding to the selected column. By default, the Round button rounds to the nearest whole number, so you will need to adjust the formula afterward.
- Edit the formula to specify two decimal places. Look at the formula bar. You will see something like
= Number.Round([ColumnName]). Change it to= Number.Round([ColumnName], 2)and press Enter. The column now shows values rounded to two decimal places. - Alternative: add a custom column. If you prefer not to overwrite the original column, go to Add Column > Custom Column. In the dialog, name the column (for example, RoundedValue) and enter the formula
Number.Round([ColumnName], 2). Click OK. A new column appears with the rounded values. - Check the data type. After rounding, confirm the column type is still Decimal Number or Whole Number as appropriate. If it shows as Text, click the type icon and change it back to a numeric type.
- Apply and close. In Excel, click Close & Load to load the results to a worksheet. In Power BI Desktop, click Close & Apply to apply the changes to your model.
Common Mistakes
- Rounding to a whole number by accident. The Round button alone rounds to zero decimal places. Always add the second argument,
2, in the formula bar. - Rounding text instead of numbers. If the column is stored as text,
Number.Roundwill fail. Convert the column to a numeric type first. - Confusing rounding with formatting. Rounding changes the underlying value. Formatting only changes how the number is displayed. If you need to keep the original value and only change the display, use number formatting in Excel or Power BI instead of Power Query.
- Forgetting that rounding affects calculations. Once rounded, the value used in downstream calculations is the rounded value, which can introduce small differences compared to the original.
- Using the wrong locale. In some regions, the decimal separator is a comma. Power Query uses the locale settings of your system; if you see unexpected results, check the locale in the query settings or use
Number.Roundwith a culture argument if needed.
Tips
- You can round multiple columns at once by selecting several columns (Ctrl+click) before clicking Round, then editing the formula for each step.
- Use
Number.Roundwith a negative second argument to round to the left of the decimal point (for example,Number.Round([Value], -1)rounds to the nearest ten). - If you need to round up or down specifically, use
Number.RoundUporNumber.RoundDownwith the same second argument. - To keep the original column and add a rounded version, use Add Column > Custom Column as described in step 5. This is safer for auditing.
- Remember that Power Query steps are recorded in the Applied Steps pane; you can rename or reorder them, but be careful when editing formulas directly as later steps may depend on the column name.
Troubleshooting
- The Round button is greyed out. Make sure you have selected a column that is already a numeric type. If the column is text, change its type first.
- The formula bar shows an error after editing. Check that you have used the correct column name exactly as it appears, including any spaces or special characters. Column names with spaces need to be enclosed in square brackets and may require the
#"Column Name"syntax. - Values still show many decimal places. The rounding may not have been applied to the correct step, or the column type may have changed. Review the Applied Steps and ensure the rounding step is after any type conversion steps.
- Numbers are rounded incorrectly (for example, 1.005 becomes 1.00 instead of 1.01). This is due to floating-point representation. Power Query uses standard rounding; for exact decimal rounding, consider using
Number.Roundwith theRoundingModeargument if your version supports it, or handle it in a later step. - The query fails to load after rounding. Check for null values.
Number.Roundreturns null if the input is null, which is usually fine, but if you have errors, use Remove Errors or replace nulls before rounding.
Frequently Asked Questions
Can I round to two decimal places without writing M code?
Yes. Select the column, click Transform > Round, then edit the formula in the formula bar to add , 2. There is no dedicated dialog for decimal places in the standard Round button, so a quick formula edit is the simplest no-code method.
Does rounding in Power Query change the original data source?
No. Power Query works on a copy of the data. The original source remains unchanged unless you explicitly write the results back to it.
What is the difference between Number.Round and Number.RoundAwayFromZero?
Number.Round uses banker's rounding (round half to even) by default, while Number.RoundAwayFromZero always rounds .5 away from zero. Use the latter if you need traditional rounding.
Can I round a column to two decimal places and keep it as text?
Yes, but you would need to convert the rounded number to text afterward using Number.ToText. However, keeping it as a number is usually better for calculations.
Why does my rounded number show as 1.2 instead of 1.20?
Power Query stores numbers without trailing zeros. To display two decimal places consistently, apply number formatting in Excel or Power BI after loading the data.
Does rounding work the same in Excel Power Query and Power BI?
Yes, the Power Query engine is the same, so the Number.Round function behaves identically. Menu locations may differ slightly between the two applications.