Power Query: Fill Down & Fill Up to Replace Nulls with Above or Below Values

Power Query Fill Down feature image showing a before-and-after HR report where the Department column had null cells below Engineering and Finance labels, and after Fill Down every row shows the correct department name in green or purple, alongside the Table.FillDown M code, a Fill Up example showing a Travel footer label propagated upward, six example pills including merged cells fix and running total, and a warning that Fill Down crosses group boundaries if blank separator rows are not removed first.
Exported reports often put a category label in the first row of each group and leave blank cells below for all other rows in that group. This looks tidy in a formatted report but breaks every formula and PivotTable that expects each row to be self-contained. Fill Down fixes it instantly — it replaces every null with the last non-null value above it, propagating the label through all rows in the group. Fill Up does the reverse, pushing a footer label upward through null cells above it. The critical detail most users miss: Fill Down only replaces null, not empty strings. This guide covers the five-step workflow, how to convert empty strings to null before filling, how to prevent Fill Down from bleeding across group boundaries, and six examples including classic category propagation, merged-cell repair, footer label fill-up, multi-column simultaneous fill, and a running balance using List.Accumulate.

Exported reports often have a category label in the first row of a group. Blank cells appear below it for all rows belonging to that category. This reads well in a formatted report. However, it breaks every formula and PivotTable that relies on each row being self-contained. Fill Down in Power Query solves this instantly. It replaces every null with the last non-null value above it. The label propagates through all rows in each group. Fill Up does the reverse.

This guide covers Fill Down and Fill Up in full, including when each applies, multiple-column fills, and six worked examples. It also covers unwanted fills at group boundaries. These include classic category-label propagation, fixing merged-cell exports, and building running totals using Fill Down on a cumulative column.

Availability: Fill Down and Fill Up are available in Power Query in Excel 365, 2021, 2019, and 2016. Both appear in Transform → Fill → Down / Up. They apply only to the selected column(s) and replace null values only — existing non-null values are never overwritten.

What Do Fill Down and Fill Up Do?

Fill Down scans top to bottom. Specifically, when it finds a null, it copies the last non-null value from above. It continues until it reaches another non-null value or the end of the column. This propagates category labels, department names, or grouping values through all rows in each group.

Fill Up works in the opposite direction. It scans bottom to top and copies the next non-null value below into null cells above it. This is less common but useful when a label appears at the bottom of each group rather than the top. Both operations only affect null values. Non-null cells are never changed.

OperationDirectionTypical sourceResult
Fill DownTop to bottomCategory in first row, nulls belowCategory repeated in every row of the group
Fill UpBottom to topLabel in last row, nulls aboveLabel repeated in every row above the group footer

How to Apply Fill Down in Power Query

1
Load your data into Power Query (Data → From Table/Range or From File).
2
Click the column header containing the partially-filled values (the column with category labels and blank cells below each label).
3
Go to Transform → Fill → Down. Nulls are immediately replaced with the value from above.
4
Repeat for any other columns that need filling. You can also Ctrl-click multiple columns before applying Fill Down to fill all of them in one step.
5
Click Home → Close & Load to output the filled table to Excel.
Null vs blank string: Fill Down only replaces null values — it does not replace empty strings (""). If your source has empty strings instead of nulls, add a Replace Values step first: replace "" with null. Then Fill Down will work correctly on those cells.

Examples 1–4: Fill Down and Fill Up in Practice

1
Propagate category labels — the classic Fill Down use case

A report exported from an accounting system has the Department name in the first row of each department group, with null cells below for all other rows in the group. Fill Down on the Department column makes every row self-contained and PivotTable-ready.

Dept (before)
Dept (after)
Employee
Salary
Engineering
Engineering
Alice
£65,000
null
Engineering
Bob
£58,000
null
Engineering
Carol
£72,000
Finance
Finance
Dave
£61,000
null
Finance
Eve
£59,000
Select the Dept column. Transform → Fill → Down. Each null is replaced with the department above it. M code: Table.FillDown(Source, {"Dept"})
2
Fix merged cell exports — un-merge and fill from Excel reports

Excel reports with merged cells export as a single value in the first cell of each merged region, with null in all remaining cells. Power Query un-merges automatically on import — but the null cells remain. Fill Down on those columns restores the full data. This also applies to PDF or web table imports where merged table headers create the same null pattern.

When Excel loads a merged-cell report into Power Query: - Merged region spanning A2:A5 (Department = "Engineering") becomes: A2 = "Engineering", A3 = null, A4 = null, A5 = null. Fill Down on the Department column: Transform → Fill → Down Result: A2=A3=A4=A5="Engineering" For multiple merged columns, Ctrl+click all affected column headers before applying Fill Down to fix them simultaneously in one step.
3
Fill Up — footer label propagated upward through the group

Some reports place a category label at the bottom of each group instead of the top. An expense report might list all transactions first, then a "Category: Travel" label at the end of each group. Fill Up propagates this bottom label upward through the null cells above it.

Source data structure: Row 1: null | Hotel | £180 Row 2: null | Flight | £420 Row 3: null | Taxi | £35 Row 4: Travel | null | null (category footer row) Row 5: null | Lunch | £28 Row 6: null | Dinner | £95 Row 7: Meals | null | null (category footer row) After Fill Up on Category column: Row 1-3: Travel (filled up from row 4) Row 4: Travel Row 5-7: Meals (filled up from row 7) Steps: Select Category column → Transform → Fill → Up. Then filter out the blank rows in Description (rows 4 and 7).
4
Guard against over-fill — stopping fill at group boundaries

Fill Down fills every null, including into the next group if there is no boundary marker. This causes the last value in one group to bleed into rows that belong to the next group. The fix is to add a sentinel value at group boundaries before filling — typically by using a Conditional Column to mark summary or subtotal rows and then filtering them out after the fill.

Problem: blank rows between groups cause over-fill. Region | Month | Revenue North | Jan | 42,000 null | Feb | 38,000 ← null fills correctly as North null | Mar | 51,000 ← null fills correctly as North null | null | null ← subtotal/separator row South | Jan | 29,000 null | Feb | 33,000 ← null would fill as "North" (wrong!) without removing the blank row first Fix: Before Fill Down, filter out blank separator rows: Home → Remove Rows → Remove Blank Rows (or filter null from the Revenue column) Then apply Fill Down on Region. Now the South group starts immediately after the last North row. Fill Down correctly starts over when it hits "South".

Examples 5–6: Fill Down with Calculations and Multiple Columns

5
Fill multiple columns at once — restore a full row of header values

A complex export may have several columns using the label-in-first-row pattern. Ctrl-clicking all affected headers fills them all in one step rather than repeating the operation column by column.

Source has three columns with sparse fills: Department, Region, and CostCentre. Each only has a value in the first row of its group; the rest are null. Ctrl+click Department, Region, and CostCentre headers. Transform → Fill → Down. All three columns are filled in a single step. M code for multiple columns simultaneously: Table.FillDown(Source, {"Department", "Region", "CostCentre"})
6
Running total using Fill Down — carry forward a balance

A bank transaction table has an Opening Balance in row 1 and null in all subsequent Balance rows. Adding each transaction amount to the prior balance is a running total calculation. In Power Query, this requires a recursive approach — or more practically, adding the cumulative sum as a list operation and then expanding it as a column.

Alternative approach for running totals (List.Generate): Avoids recursive queries that are slow on large tables. Add a custom column using List.Sum on all prior rows: = List.Sum(List.FirstN(Source[Amount], [Index] + 1)) + StartingBalance Or use List.Accumulate for a true running balance: let amounts = Source[Amount], start = 10000, ← opening balance running = List.Accumulate( List.Positions(amounts), {start}, (state, idx) => state & {state{List.Count(state)-1} + amounts{idx}} ) in Table.AddColumn(Source, "Balance", each running{[Index]})

Common Issues and How to Fix Them

Fill Down fills across group boundaries incorrectly

If Fill Down crosses into the next group, the groups lack a non-null boundary between them. Fill Down only stops when it encounters another non-null value. Ensure each group starts with a non-null category value, not just the first group. Remove rows that are entirely null in the fill column before applying Fill Down.

Fill Down is not working — blank cells are not being filled

Power Query Fill Down replaces null values only, not empty strings. If the source cells appear blank but are actually empty strings (""), Fill Down will skip them. Add a Replace Values step first: go to Transform → Replace Values, replace "" (empty string, leave the value-to-find box empty) with null. After that, Fill Down will treat those cells as fillable nulls.

Frequently Asked Questions

  • How do I fill down in Power Query?+
    Click the column header you want to fill. Go to Transform → Fill → Down. Every null cell in the column is replaced with the last non-null value above it. Non-null cells are unchanged. You can also Ctrl-click multiple column headers before applying Fill Down to fill all selected columns simultaneously. The M function is Table.FillDown(table, {"ColumnName"}).
  • What is the difference between Fill Down and Fill Up?+
    Fill Down scans top to bottom and replaces each null with the last non-null value seen above it. Fill Up scans bottom to top and replaces each null with the next non-null value below it. Fill Down is used when category labels appear at the top of each group. Fill Up is used when labels appear at the bottom of each group (for example, subtotal rows or footer labels). Both operations only affect null cells.
  • Why is Fill Down not filling my blank cells?+
    Fill Down only replaces null values. If your blank-looking cells contain empty strings ("") instead of null, Fill Down skips them. Fix this by adding a Replace Values step before Fill Down: Transform → Replace Values → leave "Value To Find" empty, set "Replace With" to null. After this step, the empty strings become true nulls and Fill Down works correctly.
  • How do I prevent Fill Down from crossing into the next group?+
    Fill Down stops when it reaches a non-null value. If your data has separator or subtotal rows that are completely null in the fill column, those rows cause Fill Down to continue into the next group. Remove blank separator rows before applying Fill Down (Home → Remove Rows → Remove Blank Rows). Alternatively, ensure the first row of every group has the correct non-null category value so Fill Down has a boundary to stop at.