Function Problems

How to Fill Blank Values with the Previous Value Using DAX in Excel

Emma BrownEmma Brown Nov 3, 2026 869 views

Question details

The user needs to populate empty sums in a calculated table by carrying forward the sum values from the previous month using DAX.

How to Fill Blank Values with the Previous Value Using DAX in Excel
Product
Excel
Device & OS
not provided
Scenario
Analyzing time-series data in Power Pivot or Power Query where certain months lack values, and the previous available month's sum needs to be carried forward to maintain continuity.
Observed behavior
Certain rows contain blank values instead of carrying over the previous month's data, which requires a specific data model structure, sort order, and a targeted DAX formula or Power Query transformation to resolve.
Before you start

Ensure your data model includes a well-defined Date or Year-Month column properly formatted as a Date type, as DAX time-intelligence calculations require a reliable chronological filter context.

Solution 1Recommended

Use the Fill Down Feature in Power Query

If you are preparing your data before loading it into the data model, Power Query offers a built-in tool that easily replaces blank values with the last non-empty value, avoiding complex DAX.

Using Power Query to clean up static blank data is generally more efficient than computing it dynamically with DAX. This method permanently fills the empty cells in the data model so that your DAX measures remain simple.

1
Open Power Query Editor

Select your data table in Excel, navigate to the 'Data' tab, and click 'From Table/Range' to open the Power Query Editor.

2
Select the Target Column

Click on the header of the column containing the blank values (sums) that you want to fill.

3
Apply Fill Down

Go to the 'Transform' tab on the top ribbon, click on the 'Fill' dropdown, and select 'Down'. This will replace all null values with the value immediately above them.

4
Load the Data

Click 'Close & Load' to bring the cleaned data back into your Excel worksheet or directly into your Power Pivot Data Model.

Data Sorting Matters: Make sure your table is sorted chronologically by the Year-Month column before applying the Fill Down step so the correct previous value is carried forward.
Free Microsoft Office alternative

Streamline Your Data Analysis with WPS Office

While advanced DAX environments like Power Pivot are specific to the Microsoft ecosystem, many data cleaning and analysis tasks can be handled much faster using intuitive spreadsheet features. WPS Office provides powerful, lightweight data tools and seamless compatibility with Excel files.

  1. 1. Open Your Data File: Launch WPS Spreadsheet and open your existing .xlsx dataset.
  2. 2. Select the Blanks: Highlight your data column, press Ctrl+G to open the 'Go To' dialog, select 'Blanks', and click OK.
  3. 3. Fill with Previous Values: Type an equals sign (=), press the Up Arrow key to reference the cell directly above, and press Ctrl+Enter to instantly fill all blanks.
Highly compatible with Microsoft Excel (.xlsx) formats and standard formulas.Lightweight architecture ensures fast performance even with large datasets.Built-in 'Go To Special' tools to fill blank cells quickly without coding.Completely free for standard data analysis and PivotTable generation.
microsoft office alternative - wps office

Frequently Asked Questions

Why is my DAX formula returning a blank instead of the previous month's value?

This usually happens due to an issue with the filter context or if your Date table is not properly linked to your fact table. Ensure your Year-Month column is formatted correctly as a date type and that the relationships in your data model are active.

Should I use Power Query or DAX to fill blank values?

If the blank values are static and just need to be cleaned up before analysis, Power Query's 'Fill Down' feature is much simpler and improves performance. Use DAX only if the values need to be dynamically calculated based on changing user selections in a dashboard.

Can I fill blank values with the previous cell's data without using DAX or Power Query?

Yes, you can use the native spreadsheet tools. Select your data range, press Ctrl+G to open the Go To dialog, select 'Special' and then 'Blanks'. Type an equals sign (=), press the Up arrow key, and press Ctrl+Enter to fill all empty cells with the value immediately above them.