Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

Power Query Number.Round Function: How to Round Numbers Correctly

· 5 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

The Number.Round function in Power Query rounds a number to a specified number of decimal places or to the nearest multiple, using standard rounding rules. It’s essential for cleaning numeric data before analysis, especially when dealing with financial values, measurements, or aggregated metrics. No additional tools or installations are needed—this function is built into Power Query in Excel, Power BI, and other Microsoft data tools that support M language.

What You'll Need

  • Microsoft Excel 2016 or later with Power Query enabled, or Power BI Desktop
  • A table or query containing numeric columns you wish to round
  • Access to the Power Query Editor (Data > Get Data > Transform Data in Excel; Transform Data in Power BI)

Step-by-Step

  1. Open your data source in Power Query Editor. In Excel, go to the Data tab and select Get Data > From Table/Range or From Other Sources. In Power BI, select Transform Data from the Home tab. Ensure your data is loaded as a table or query.
  2. Identify the column you want to round. Click on the column header to select it. The column must contain numeric values (Integer, Decimal, or Currency). If it contains text, convert it first using Number.From.
  3. Go to the Transform tab in the ribbon. In the Number section, click on the Round dropdown menu. Choose Round to nearest to access the basic rounding function.
  4. For simple rounding to decimal places, select the number of decimal places from the dropdown (e.g., 0, 1, 2). This applies Number.Round to the column, rounding each value to the nearest value with that precision. For example, 3.678 rounded to 2 decimal places becomes 3.68.
  5. For custom rounding (e.g., to the nearest 5, 10, or 0.25), select the option "Round to nearest" and then click "Advanced" in the dialog box. Enter the desired multiple in the "Multiple" field. For instance, rounding 23 to the nearest 5 returns 25; rounding 1.7 to the nearest 0.5 returns 1.5.
  6. If you need to use the exact M function syntax (e.g., for conditional rounding or combining with other functions), click on the column header, then go to Add Column > Custom Column. In the formula bar, type: Number.Round([ColumnName], 2, RoundingMode.TowardZero). Replace [ColumnName] with your actual column name, 2 with the number of decimals, and RoundingMode.TowardZero with your preferred mode (see Tips section).
  7. Press OK. The new column will appear with rounded values. You can rename it by right-clicking the header and selecting Rename.
  8. Apply changes by clicking Close & Load (Excel) or Close & Apply (Power BI). The transformed data replaces the original table in your workbook or report.

Common Mistakes

  • Applying Number.Round to text columns without converting them first—this causes an error. Always validate the data type using the column icon (lightning bolt) next to the header.
  • Assuming rounding always rounds up. Number.Round uses banker’s rounding (round to nearest even) for midpoint values (e.g., 2.5 becomes 2, 3.5 becomes 4). This is correct mathematically but may surprise users expecting traditional rounding.
  • Forgetting to specify the rounding mode when precision matters. Using the default may yield unexpected results in financial contexts where bias matters.
  • Using the Round function from the Transform tab without checking the result—sometimes it applies to the wrong column if multiple are selected.
  • Trying to round non-numeric values like dates or boolean values—Number.Round only works on numbers.

Tips

  • Use RoundingMode.Up to always round up (ceiling), RoundingMode.Down to always round down (floor), or RoundingMode.TowardZero to truncate decimals. This gives you fine control beyond standard rounding.
  • Combine Number.Round with Number.From to clean imported text numbers: Number.Round(Number.From([TextColumn]), 2) safely converts and rounds in one step.
  • For currency, always round to 2 decimal places. Use Number.Round([Amount], 2, RoundingMode.AwayFromZero) to avoid banker’s rounding in accounting contexts.
  • Test your rounding with edge cases: 0.5, 1.5, 2.5. Understand how banker’s rounding affects your final totals.
  • Use the Formula Bar to preview the M code before applying. This helps you replicate the logic elsewhere or debug issues.
  • Apply rounding early in your query pipeline—before aggregations—to avoid compounding rounding errors in sums and averages.

Troubleshooting

  • Error: "We cannot convert a value of type Text to type Number" — This means your column contains non-numeric text. Use Transform > Data Type > Decimal or Integer first, or wrap the column in Number.From() in a Custom Column.
  • Rounding gives unexpected results like 2.5 → 2 — This is banker’s rounding. If you need traditional rounding (2.5 → 3), use RoundingMode.AwayFromZero in the Advanced options or Custom Column: Number.Round([Value], 2, RoundingMode.AwayFromZero).
  • Column disappears or turns blank — You may have applied rounding to a column with null values. Use Table.TransformColumns with a conditional: each if _ = null then null else Number.Round(_, 2).
  • Formula syntax error — Check parentheses and commas. M language is strict. Example: Number.Round([Sales], 2) not Number.Round([Sales, 2]).
  • Changes don’t appear after clicking Close & Load — Make sure you applied the step and didn’t cancel it. Reopen Power Query Editor and check the Applied Steps pane on the right. Delete and reapply the rounding step if needed.

Frequently Asked Questions

Does Number.Round affect the original data in the source file?

No. Power Query creates a transformation layer. Your original Excel sheet or database remains unchanged. Only the loaded result in Excel or Power BI is modified.

Can I round to whole numbers using Number.Round?

Yes. Set the decimal places to 0. Number.Round([Value], 0) rounds to the nearest integer using banker’s rounding.

Is banker’s rounding the same as rounding to even?

Yes. Banker’s rounding means when a number is exactly halfway between two values (like 1.5 or 2.5), it rounds to the nearest even number (1.5 → 2, 2.5 → 2). This reduces statistical bias over large datasets.

Why does my rounded total not match the sum of rounded values?

This happens due to cumulative rounding errors. For example, 1.4 + 1.4 = 2.8, which rounds to 3, but 1 + 1 = 2. Always sum first, then round the total—or use a custom column to round after aggregation.

Can Number.Round handle negative numbers?

Yes. It works identically for negative values. Number.Round(-2.7, 0) returns -3. Rounding modes like TowardZero will round -2.7 to -2.

What if I need to round to the nearest 100 or 0.1?

Use the Advanced option in the Round menu and enter the multiple (100 or 0.1). Or use Number.Round([Value], 0, 100) in a Custom Column to round to the nearest hundred.