Fill down group labels in Power BI Power Query
Use Fill Down in Power Query when a group label is present on the first row of a group and null on its following rows. The operation carries the preceding value into later null cells until another value appears. It is useful for cleaning a report-style export into a row-based table. It should only be used when the source meaning supports that rule; an empty cell is not automatically evidence that the previous label is correct.
Build a small example
In a practice Power BI Desktop file, use Enter data to make a table with Department and Item columns. Create six rows in this order: Studio with Paper, blank with Tape, blank with Pens, Store with Folder, blank with Labels, and blank with Clips. Call the table SupplyGroups. Open it in the Power Query editor through Transform data. This invented export represents two departments whose labels were printed once per group rather than repeated on every line.
Inspect the Department cells before applying a command. Power Query distinguishes null from an empty text string and from text containing spaces. A blank-looking cell can belong to any of these cases. Microsoft's fill guidance explains that empty cells may need conversion to null before filling. In this exercise, the cells below Studio and Store should represent missing group labels. Do not replace legitimate values merely to force the example to behave as expected.
Apply the operation to one column
Select the Department column, open its context menu, and choose Fill, then Down. Check the six rows immediately. Paper, Tape, and Pens should now have Studio as their department; Folder, Labels, and Clips should have Store. The Item column should be unchanged. Read across each row rather than looking only at the filled column, because the practical requirement is that every item remains attached to its correct department.
In Applied Steps, find the new fill step. Keeping the transformation as a separate step helps you inspect what happened before and after it. Click the preceding step to see the original missing labels, then return to the fill step. You should be able to describe the change in plain language: null department labels were replaced using the nearest preceding department value. If you cannot explain the source rule, investigate the export before accepting the cleaned table.
Preserve the meaningful row order
Fill Down follows the order presented to the operation. Sorting the Item column alphabetically before filling would move labels away from the rows they were intended to describe. In this example, the original sequence is part of the data's meaning. Apply the fill while that sequence is intact. If you need another sort for a visual or a later transformation, do it after the missing department labels have been assigned and checked.
For a recurring file import, identify what guarantees that order. A source row number or a documented export sequence is more reliable than an assumption based on one preview. Where no stable ordering exists, a different data preparation approach may be needed. Do not add a sort solely because a tutorial suggests that tables look tidier alphabetically. The transformation must reflect how the source encodes groups, particularly when each group contains several distinct line items.
Recognize cells that should remain missing
Add a new first row with no Department and Item set to Unknown delivery. Fill Down cannot invent a preceding label for that row, so it remains missing. That is useful evidence of an unresolved source issue. A later label belongs to a later group and should not automatically be pulled upward. Fill Up is a separate operation with a different direction, and using it just to remove every null can silently assign the wrong department.
Likewise, imagine a blank separator row between groups. Filling its Department would not make the separator a real item. Filter or remove report furniture according to a documented rule before loading the result. Total rows, repeated headings, and notes can resemble data rows in exported reports. Check the whole table structure rather than treating the absence of nulls as the definition of success. A completely populated table can still contain misclassified or non-data rows.
Handle empty strings carefully
If some cells do not fill, inspect them for empty strings or spaces. Convert only the cells that genuinely mean missing department into null, then rerun Fill Down. Keep that cleanup step visible. Do not use a blanket replacement that erases a meaningful category or changes every blank in unrelated columns. The department rule does not imply that a blank quantity, date, or price should inherit a value from the row above.
The operation is documented in Microsoft Power Query and is available through the editor used by Power BI Desktop. Menus can differ across products and versions that host Power Query. This article describes the editor transformation rather than a DAX calculated column or a report visual setting. Close and Apply only after reviewing the preview. Refresh against a changed practice source to confirm that the rule still produces the intended group assignments when additional rows appear.
Test the rule with a new group
Add Workshop with Envelopes and a following missing department with Cards to your practice source. Refresh or revisit the entry step as appropriate, then inspect the fill result. Both new items should belong to Workshop while the earlier six assignments remain intact. Record the expected department beside each item before checking the result. Which source change would make this method unsafe: an extra item within a group, or a sort that separates labels from their following rows? Explain the difference before using the query on a real export.














