Power Query Table.FillDown: Step-by-Step Guide
In this article
Table.FillDown fills blank cells in a Power Query column with the value from the cell directly above, repeating downward until it hits a non-blank value. It is the standard fix for data exported from merged cells or hierarchical reports, where a category name appears once and then leaves blanks beneath it. You do not need to install anything extra: Table.FillDown is a built-in M function available in Excel's Power Query Editor (Data > Get & Transform Data) and in Power BI Desktop's Power Query Editor. The function works on a table column and returns a new table, so it is applied through the M code or through the Transform tab's Fill > Down command, which writes the function for you.
What You'll Need
- A table already loaded into Power Query: in Excel, select your data and use Data > From Table/Range; in Power BI, use Home > Transform data to open the editor.
- The column you want to fill must be text or a type that can hold the repeated value; if the column is typed as a number and contains blanks, decide whether you want the fill before or after changing the type.
- A clear idea of which blanks are intentional. Table.FillDown fills every blank in the column, including blanks that should stay empty.
Step-by-Step
- Load your source into Power Query. In Excel: select a cell in your table, then Data > From Table/Range. In Power BI Desktop: Home > Transform data. Menu labels can differ slightly by version and region.
- In the Power Query Editor, select the column that contains the blanks and the values you want repeated. Click the column header once.
- Use the ribbon command: go to the Transform tab and choose Fill > Down. This is the point-and-click equivalent of Table.FillDown and is the safest route if you are new to M.
- Check the result in the preview. The blanks should now show the value from the row above. If the wrong column was selected, press Ctrl+Z to undo the step.
- To write it manually, open the Advanced Editor (Home > Advanced Editor) or the formula bar and add a step such as:
= Table.FillDown(PreviousStep, {"Category"}). Replace PreviousStep with the name of your prior step and Category with the exact column name, including its capitalization. - If you need to fill more than one column, pass a list:
= Table.FillDown(PreviousStep, {"Category", "Subcategory"}). The function fills each listed column independently, top to bottom. - Decide whether to fill before or after other cleaning steps. Filling after you have removed null rows will do nothing, because those rows are already gone. Filling before filtering is usually correct.
- Apply the change: Home > Close & Load (Excel) or Home > Close & Apply (Power BI) to write the result back to your workbook or model.
Common Mistakes
- Filling the wrong kind of blank. Table.FillDown cannot tell an intentional empty cell from a missing label. If some rows should stay blank, filter or flag them first, or fill only a subset of rows.
- Wrong column name. The M function is case-sensitive about column names. A typo or a renamed column produces an error rather than a silent failure.
- Filling after a type change. If a column was changed to a numeric type and the fill value is text, the step can error. Fill first, then change the type.
- Expecting it to fill upward or sideways. Table.FillDown only repeats values downward. There is a separate Table.FillUp for the opposite direction, and no built-in horizontal fill.
- Forgetting the step is order-dependent. Moving the Fill Down step above a sort or filter changes the result, because the fill uses whatever order exists at that moment.
Tips
- Sort the table into its intended order before filling. If rows are shuffled later, the filled values no longer line up with the right groups.
- Use Fill Down on a duplicated column when you want to keep the original blanks for reference.
- Combine it with Table.FillUp when a column has both leading and trailing blanks around a single value.
- Name your steps clearly in the Applied Steps pane so the Fill Down step is easy to find and reorder.
- For grouped data, filling inside Table.Group is possible but advanced; for most reports, a plain Fill Down before grouping is simpler and easier to audit.
Troubleshooting
- The step errors with "column not found". Open the step and confirm the exact column name in the previous step's output; rename it in the formula if needed.
- Nothing changes. The column may contain empty strings rather than true nulls, or the rows may already have been filtered out. Check the step order and inspect a few cells.
- The fill repeats the wrong value. The table order at that step is not what you expect. Move a sort step above the fill, or undo and reapply the fill after sorting.
- The column turns into errors after loading. A type mismatch is likely. Set the column type after the fill, or fill a text column and convert later.
- You cannot find the Fill button. Make sure a column is selected and you are on the Transform tab; the command is not on the Home tab in every version.
- If that did not work, delete the Fill Down step, confirm the source data still has the blanks, and reapply the step from the ribbon rather than editing the formula by hand.
Frequently Asked Questions
Does Table.FillDown change my original data?
No. It returns a new table inside the query. Your source file or database is untouched unless you write the query output back to it.
Can I fill down more than one column at once?
Yes. Pass a list of column names as the second argument, for example {"Category", "Region"}. Each column is filled independently.
What is the difference between Fill Down and replacing nulls?
Fill Down copies the nearest value above. Replacing nulls substitutes one fixed value everywhere. Use Fill Down when the correct value varies by group.
Does it work on numbers and dates?
Yes, as long as the column type is consistent. Fill before changing the type if the repeated value might not match the target type.
Is there a Fill Right function?
No. Power Query has Table.FillDown and Table.FillUp only. For horizontal filling you would need a custom transformation, such as unpivoting and re-pivoting the table.
Why does the fill stop partway down?
It does not stop; it repeats the last non-blank value until the next non-blank one. If the result looks partial, a later step is probably filtering or re-sorting the rows.