Table.FillDown

Table

Replaces null values in specified columns with the most recent non-null value above.

Examples on this page use shared sample tables. View them to understand the input data before reading the examples below.

Syntax

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

Parameters

NameTypeRequiredDescription
tabletableYesThe input table containing null values to fill.
columnslistYesA 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
    FilledDown
Applied Steps

The 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
1EastWidget A4
2EastWidget C10
3EastThingamajig E1
4NorthGadget D1
5NorthWidget C8
6WestGadget B2
7WestWidget A6
8WestGadget B3

Compatibility

✓ Power BI Desktop✓ Power BI Service✓ Excel Desktop✓ Excel Online✓ Dataflows✓ Fabric Notebooks
Contributors
kyleamueller