Power Query Problems

Change One Value in a Filtered Power Query Row in Excel

John WilsonJohn Wilson Nov 18, 2026 868 views

Question details

Change a value in one identified Power Query row without replacing every matching value in the column.

Change One Value in a Filtered Power Query Row in Excel
Product
Microsoft Excel Power Query
Device & OS
not provided
Scenario
A user wants to replace a null cost for a specific product in a filtered query.
Observed behavior
Replace Values changes every matching null in the selected column rather than only the intended record.
Before you start

Identify a column or combination of columns that uniquely identifies the target row. Check the target column's data type and decide what value should replace the null.

Solution 1Recommended

Use a conditional custom column to update the target row

Use this method to replace a null only when the row also meets your identifying criteria.

The condition applies to every row that matches it, so add more criteria if the product name alone is not unique.

1
Open the query

In Excel, go to Data > Queries & Connections, then open the query in Power Query Editor.

2
Add a custom column

In Power Query Editor, select Add Column > Custom Column and name it Corrected Cost.

3
Enter the condition

In the formula box, enter: if [Product] = "x" and [Cost] = null then 15 else [Cost]. Replace x, 15, and the column names with your actual product, replacement value, and columns.

4
Check the results

Select OK and inspect the Corrected Cost column. If more than one row changes, edit the custom column step and add another condition that uniquely identifies the target record.

5
Replace the original column

Set Corrected Cost to the appropriate data type. If it should replace Cost, remove the original Cost column, rename Corrected Cost to Cost, and select Home > Close & Load.

Use a conditional custom column to update the target row
Check later query steps: Removing or renaming a column can affect subsequent steps that reference it. Review those steps if the query reports an error.
Free Microsoft Office alternative

Edit spreadsheet values with WPS Office

For direct spreadsheet editing, WPS Office is a free, lightweight alternative with a familiar interface and support for Microsoft Office formats. Open an existing workbook and edit cells without starting over; WPS does not fix or replace Excel Power Query transformations.

Edit individual spreadsheet cells directly in WPS SpreadsheetOpen and save Microsoft Excel XLSX filesUse a familiar interface for an easier transition from OfficeWork with a lightweight office suite for free
microsoft office alternative - wps office

Frequently Asked Questions

Why did Replace Values change more than one row?

Replace Values acts on matching values in the selected column at that query step. Use Add Column > Custom Column with conditions that identify the intended record as well as the value to replace.

What if several rows have the same product name?

Add another identifying condition to the custom column formula, such as and [OrderID] = 123, using a column and value that distinguish the target row.

Will the conditional replacement apply after a refresh?

Yes. The custom column is a query step, so Power Query evaluates the condition again when you refresh. Any rows matching the condition at that time will receive the replacement.

Can I keep both the original and corrected values?

Yes. Leave the original Cost column in place and keep the new column under a different name, such as Corrected Cost, before selecting Home > Close & Load.