logo
search
Others

How to Calculate Previous and Next Values in Power BI

Algirdas JasaitisAlgirdas Jasaitis Oct 1, 2026 869 views

Question details

The user needs to calculate an expected value for blank sales records by averaging the values from surrounding dates.

How to Get Help Calculating Previous and Next Values in Power BI
Product
Power BI
Device & OS
not provided
Scenario
Filling blank sales values with averages of previous and next dates in a data report.
Observed behavior
Requires specific DAX formulas and data-model guidance to calculate moving averages and fill gaps in the dataset.
Before you start

Before posting your question in specialized forums, ensure you have your data model schema and a small sample dataset ready to share, as this helps experts provide precise DAX formulas.

Solution 1Recommended

Seek Help in the Microsoft Fabric Community

The most effective way to solve complex DAX and data modeling problems is to consult Power BI specialists in the official community.

Advanced row-context calculations, such as finding previous and next values to interpolate blank data, often require specialized DAX functions (like OFFSET, INDEX, or EARLIER) and a properly structured date table. The official Microsoft Fabric Community is the best place to get personalized DAX code for your specific data model.

1
Visit the Community Forum

Navigate to the official Microsoft Fabric Community website in your web browser and locate the Power BI Desktop forums.

2
Search for existing solutions

Use the search bar to look for terms like 'calculate previous and next values' or 'interpolate blank values DAX' to see if your specific scenario has already been resolved.

3
Create a new post

If no existing solution fits your needs, create a new topic detailing your table structure, current DAX formula attempts, and the specific requirement to average surrounding dates.

Seek Help in the Microsoft Fabric Community
Best Practice for Forums: Always provide a sample dataset (removing sensitive or confidential business information) and a mockup of your expected results when asking for DAX help.
Free Microsoft Office alternative

Handle Daily Data Analysis with WPS Office

While Power BI is necessary for complex data modeling, WPS Spreadsheet offers a lightweight and highly compatible alternative for everyday data analysis. You can easily calculate missing values, averages, and generate everyday reports without the steep learning curve of DAX.

  1. 1. Download and Install: Get WPS Office from the official website and install it on your device.
  2. 2. Open your dataset: Launch WPS Spreadsheet and import your raw CSV or XLSX sales data.
  3. 3. Apply average formulas: Use simple spreadsheet functions like =AVERAGE() to reference surrounding cells and quickly interpolate blank values.
Seamlessly open, edit, and save Microsoft Excel (.xlsx) file formats.Easily calculate missing values and moving averages using familiar spreadsheet formulas.Lightweight software that runs smoothly on Windows, Mac, and Linux systems.Free to download and use for your daily office and reporting tasks.
microsoft office alternative - wps office

Frequently Asked Questions

Can I calculate previous and next values using standard spreadsheet functions?

Yes. In traditional spreadsheet software like Excel or WPS Spreadsheet, you can easily reference previous and next cells using standard row references (for example, using =AVERAGE(B2, B4) to fill a blank in B3). Power BI, however, requires DAX functions since it operates on entire columns and tables rather than specific cell coordinates.

What DAX functions are typically used for finding previous and next values in Power BI?

Advanced Power BI users often utilize window functions such as INDEX, OFFSET, or specific time intelligence functions combined with CALCULATE to retrieve values from previous or subsequent rows based on a sorted order.

Why do I get errors when trying to average previous and next rows in DAX?

DAX does not natively understand 'previous' or 'next' without a clear sorting context. You must have a properly defined Date table and use functions that can evaluate the row context (like creating an index column or using window functions) for the calculations to work correctly.