Table.FillDown
Fills the nulls of the columns you name with the value above them.
Group: Table. Power Query M has it too: a query that uses it is written as in Power BI.
Syntax
Table.FillDown(table as table, columns as list) as table
| Parameter | Type | Description |
|---|---|---|
table | table | The table to fill. |
columns | list | The columns to fill. |
Returns
table. The table with each null replaced by the nearest value above it in its column.
Remarks
- Only null is filled: an empty text "" stays. Replace it with null first when an export writes blanks that way.
- A null with no value above it stays null.
Examples
A shop written once per block
let
Report = #table({"Shop", "Product", "Units"}, {{"Oslo", "Chair", 4}, {null, "Lamp", 6}, {"Bergen", "Desk", 1}, {null, "Chair", 2}})
in
Table.FillDown(Report, {"Shop"})
| Shop | Product | Units |
|---|---|---|
| Oslo | Chair | 4 |
| Oslo | Lamp | 6 |
| Bergen | Desk | 1 |
| Bergen | Chair | 2 |