Table.FillDown
TableReplaces null values in specified columns with the most recent non-null value above.
Syntax
Table.FillDown(table as table, columns as list) as tableParameters
| Name | Type | Required | Description |
|---|---|---|---|
table | table | Yes | The input table containing null values to fill. |
columns | list | Yes | A list of column names in which to propagate non-null values downward. |
Return Value
table — The input table with null values in the specified columns replaced by the last non-null value above.
Remarks
Table.FillDown scans each specified column from top to bottom. When it encounters a null, it replaces it with the most recent non-null value from above in the same column. If the first value in a column is null, it remains null because there is no preceding value to propagate.
This function is commonly used after operations like unpivoting or when importing data where group headers appear only once and subsequent rows are blank.
Examples
Example 1: Fill down a single column
let
// A grouped report export: each Region appears only on the first row of its group
Source = #table(
type table [Region = nullable text, Product = text, Quantity = number],
{
{"East", "Widget A", 4},
{null, "Widget C", 10},
{null, "Thingamajig E", 1},
{"North", "Gadget D", 1},
{null, "Widget C", 8},
{"West", "Gadget B", 2},
{null, "Widget A", 6},
{null, "Gadget B", 3}
}
),
FilledDown = Table.FillDown(Source, {"Region"})
in
FilledDownThe final output — Table.FillDown replaces each null Region with the nearest non-null value above it, so the East, North, and West labels fill their whole groups.
Region | Product | Quantity | |
|---|---|---|---|
| 1 | East | Widget A | 4 |
| 2 | East | Widget C | 10 |
| 3 | East | Thingamajig E | 1 |
| 4 | North | Gadget D | 1 |
| 5 | North | Widget C | 8 |
| 6 | West | Gadget B | 2 |
| 7 | West | Widget A | 6 |
| 8 | West | Gadget B | 3 |