Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
Anonymous
Not applicable

Extrapolate Data from Last Week Sales

Hi there, 

 

I want a column or measure that takes the average of the last 7 days and stores it in the future dates (Extrapolating).

When data is entered, the forecast value is replaced and the new recorded data is used as part of the calculation (Rolling Filter).

 

Shown below is some example data and how I want it to look:

 

DateSales 
4/28/201810ignored
4/29/20185ignored
4/30/20186part of forecast calculation
5/1/20184part of forecast calculation
5/2/20186part of forecast calculation
5/3/20183part of forecast calculation
5/4/20184part of forecast calculation
5/5/20186part of forecast calculation
5/6/20189part of forecast calculation
5/7/2018avgforecasted
5/8/2018avgforecasted
5/9/2018avgforecasted
5/10/2018avgforecasted
5/11/2018avgforecasted
5/12/2018avgforecasted
5/13/2018avgforecasted
5/14/2018avgforecasted
infinityavgforecasted
3 REPLIES 3
v-yuta-msft
Community Support
Community Support

Hi coreyweiss,

 

You requirement is to achieve an average value in last 7 days in every row, right? You can create a measure using DAX like below:

Avg = 
VAR DateStart = MAX(Table1[Date]) - 7
VAR DateEnd = MAX(Table1[Date]) - 1
RETURN
CALCULATE(AVERAGE(Table1[Sales]), Table1[Date] >= DateStart && Table1[Date] <= DateEnd)

捕获.PNG 

You can refer to PBIX file here: https://www.dropbox.com/s/uibfaml6qe26zum/Extrapolate%20Data%20from%20Last%20Week%20Sales.pbix?dl=0.

 

Best Regards,

Jimmy Tao

Anonymous
Not applicable

Hi Jimmy,

 

Your average value in the last 7 days works perfectly, Thank you.

 

However, is it possible to have the historical data in the same measure? I would like to achieve a result like this: 

 

38.png

The data would be similar to what I initially posted in my question. Thanks!

Hi coreyweiss,

 

You want to truncate the date column by previous date and future date and then connect previous date with measure, right.  I'm afraid your requirement can't be achieved because measure will filter values which meets the condition. As a workaround, you can create a line chart and drag column [Sales] and measure [avg] to Values field like below and then you can compare the difference more clearly.

捕获.PNG 

Best Regards,

Jimmy Tao

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.