Downloads
Power Query MTable: values and fillBeginner

Table.FillDown

Fills blank cells in the listed columns with the value from the row above.

Syntax
Table.FillDown(table as table, columns as list) as table

Returns: The table with blanks filled down.

What it does

Many reports show a label once for a block of rows. In Excel this is a merged cell, and only the first row has the account name. Table.FillDown copies the last filled value downward into the blank cells below, so every row carries its label. It is the first thing to do with a grouped export.

Syntax and arguments

Example

A general ledger export lists the account name only on the first line of each account. Every row is filled down with the account name, so the postings can be summarized by account.

let
    Source = Excel.CurrentWorkbook(){[Name = "GLExport"]}[Content],
    Filled = Table.FillDown(Source, {"Account Name"})
in
    Filled

Each blank Account Name takes the name from the nearest row above it. The rows keep their own amounts.

Example: a second, different use

A budget sheet has a department name only on the first row of each block, and some rows below it are blank. Both the department and the period are filled down.

let
    Source = Excel.CurrentWorkbook(){[Name = "BudgetByDept"]}[Content],
    Filled = Table.FillDown(Source, {"Department", "Period"})
in
    Filled

Things to watch

In business terms

Account and department labels that appear once per group are the norm in ledgers, budgets and aging reports. Filling them down is the step that turns a formatted report into a table you can summarize.

Related functions

All Power Query M functions · View as Markdown · M basics