Table.FillUp Function (Power Query M)

Table.FillUp fills empty cells in the chosen columns with the next non-null value found below them. Available in Excel (Power Query), Power BI Desktop, and Power BI Service.

If you have a column with gaps and you want each blank to borrow the value sitting beneath it, this is the function you reach for. It is the bottom-up partner to Table.FillDown.

Syntax of Table.FillUp Function

Table.FillUp(table as table, columns as list) as table

where

  • table (required, table). The table you want to fill.
  • columns (required, list). A list of column names to fill, for example {"Region"} or {"Region","Revenue"}. Only these columns are touched.

Returns: a table where each null in the listed columns is replaced by the first non-null value below it. A null with nothing non-null below it stays null.

In plain terms, it scans each listed column from the bottom up and pushes values upward into the empty cells above them.

Example 1: Fill a single column upward

You have a warehouse stock list where one bin count is missing.

You want that gap filled with the count from the bin below it.

Here is the starting data:

BinPallets
A14
A2
A37

Fill the Pallets column upward:

let
Source = Excel.CurrentWorkbook(){[Name="WarehouseStock"]}[Content],
Result = Table.FillUp(Source,{"Pallets"})
in
Result

The empty A2 cell takes the 7 from A3 below it.

The result:

BinPallets
A14
A27
A37

A1 already had a value, so it is untouched.

Example 2: Propagate one value across several blank rows

A shift log records who supervised each slot, but only when the supervisor changes.

You want every blank slot to show the next named supervisor below it.

Here is the starting data:

SlotSupervisor
OpeningMaria
Mid-morning
Midday
AfternoonDevon

Fill the Supervisor column upward:

let
Source = Excel.CurrentWorkbook(){[Name="ShiftLog"]}[Content],
Result = Table.FillUp(Source,{"Supervisor"})
in
Result

Both blank rows look down, find Devon, and take that value.

The result:

SlotSupervisor
OpeningMaria
Mid-morningDevon
MiddayDevon
AfternoonDevon

One value can jump up several rows at once to fill a whole run of blanks.

Example 3: Fill several columns at once

A pivot-table export left gaps in both the Region and Revenue columns.

You want to fill both columns upward in one step.

Here is the starting data:

QuarterRegionRevenue
Q1500
Q1North
Q2South640
Q2720

Pass both column names in the list:

let
Source = Excel.CurrentWorkbook(){[Name="PivotExport"]}[Content],
Result = Table.FillUp(Source,{"Region","Revenue"})
in
Result

Each listed column is filled independently from the bottom up.

The result:

QuarterRegionRevenue
Q1North500
Q1North640
Q2South640
Q2720

The last Region cell stays blank because there is no value below it to pull up.

Example 4: A trailing blank has nothing below it

Daily meter readings have two gaps, including one on the very last row.

You want to see how Table.FillUp treats a blank with no value beneath it.

Here is the starting data:

DayReading
Mon12
Tue
Wed18
Thu

Fill the Reading column upward:

let
Source = Excel.CurrentWorkbook(){[Name="MeterReadings"]}[Content],
Result = Table.FillUp(Source,{"Reading"})
in
Result

Tue borrows 18 from Wed, but Thu is the last row with nothing below it.

The result:

DayReading
Mon12
Tue18
Wed18
Thu

The trailing Thu cell stays empty. Table.FillUp never wraps around to the top.

Example 5: Count the blanks left after filling

A course roster has several seats with no instructor assigned yet.

After filling upward, you want to count the rows that still have no instructor (the ones with nothing below them).

Here is the starting data:

SeatInstructor
1
2
3Lena
4

Fill, then count the remaining null cells:

let
Source = Excel.CurrentWorkbook(){[Name="CourseRoster"]}[Content],
Filled = Table.FillUp(Source,{"Instructor"}),
Result = Table.RowCount(Table.SelectRows(Filled,each [Instructor] = null))
in
Result

Result: 1

Seats 1 and 2 pull Lena up from seat 3, but seat 4 is the last row, so it stays null.

Things to keep in mind with Table.FillUp

  • It only fills genuine null cells, not blank text. An empty string "" or a space is a real value and gets skipped. Replace blanks with null first using Table.ReplaceValue or Replace Values with the “blank to null” option.
  • Asking for a missing column is different from a blank cell. A blank cell is a null value in an existing column, which is what Table.FillUp works on. To add a column that is missing entirely as null, see Table.SelectColumns.
  • A trailing null at the bottom stays null. There is nothing below it to pull up (Examples 3 and 4). Use Table.FillDown if a leading blank at the top is your problem instead.
  • Each column in the list fills on its own. A blank in Region looks only at Region values below it, never at another column.
  • A wrong column name throws. Expression.Error: The column 'Regoin' of the table wasn't found. Check the name and spelling against the actual headers.
  • The fill is row-order dependent. It uses the table’s current order, so sort the table the way you want before filling, since Table.FillUp has no awareness of groups.

Common questions about Table.FillUp

What is the difference between Table.FillUp and Table.FillDown?

Table.FillUp pulls values upward from the cell below, so blanks borrow from beneath them. Table.FillDown pushes values downward from the cell above, which is the more common need after expanding a grouped or merged column.

Can Table.FillUp fill only within groups, not across the whole column?

Not on its own. It fills straight up the entire column. To stop the fill from crossing group boundaries, group the table first with Table.Group, fill inside each group, then combine the results.

List of All Power Query Functions

Related Power Query Functions / Articles:

I am a huge fan of Microsoft Excel and love sharing my knowledge through articles and tutorials. I work as a business analyst and use Microsoft Excel extensively in my daily tasks. My aim is to help you unleash the full potential of Excel and become a data-slaying wizard yourself.