Reply
avatar user
Anonymous
Not applicable
Partially syndicated - Outbound

Get 6 month average of ACWP to forecast the next 6 months in power bi

I have a table called Process and it contains columns as below

Period_MonthYearEAACWPPLANNED
P1 Apr-23110010101200
P2 May-23122312001400
P3 Jun-23150012221800
P4 Jul-23167012302000
P5 Aug-23186012342200
P6 Sep-23205512442500
P7 Oct-23   
P8 Nov-23   
P9 Dec-23   
P10 Jan-24   
P11 Feb-24   

The Period_MonthYear is join / related to DateTable

I have data up to P6 Sep-23. 
I want to get the Average of ACWP for the last 6 months, then divide the average by 6 which is 6 months and the add it to EA last period that is P6 Sep-23 and to forecast EA the next 6 months.

Below is an calculation
The Forecast EA is calculated as follow 
1. get Average of 6 month ACWP which is Average ACWP =1190

2. divide Average ACWP  by 6 (6months) that is 1190/6 will give 198.33

3. Forecast EA is calculated as : get the EA last date that is P6 Sep-23 and the value is 2055 and add 198.33 and will give 2259.33

keep adding 198.33 to the last Forecast EA for the next 6 months. as shown below.

Period_MonthYearEAACWPPLANNEDForecast EA
P1 Apr-23110010101200 
P2 May-23122312001400 
P3 Jun-23150012221800 
P4 Jul-23167012302000 
P5 Aug-23186012342200 
P6 Sep-232055124425002055.00
P7 Oct-23   2259.33
P8 Nov-23   2463.67
P9 Dec-23   2668.00
P10 Jan-24   2872.33
P11 Feb-24   3076.67

 

As a result of the above calculation I want to achieve the below line chart based on above

tek01_0-1716417830450.png

How can I achieve this in power bi

 

1 ACCEPTED SOLUTION
v-yohua-msft
Community Support
Community Support

Syndicated - Outbound

Hi, @Anonymous 

First create a new measure to calculate the 6-month average of the ACWP:

Average ACWP = CALCULATE(AVERAGE('Table'[ACWP]), ALLSELECTED('Table'))

Then create an Index column in PowerQuery and create a new calculated column:

vyohuamsft_0-1716448484904.png

 

Forecast EA = 
VAR LastEA = CALCULATE(MAX('Table'[EA]), ALL('Table'))
VAR AvgACWP = [Average ACWP] / 6
RETURN 
IF('Table'[Index]>=6,SUMX(FILTER('Table','Table'[Index]<=EARLIER('Table'[Index])&&'Table'[EA]=BLANK()),AvgACWP)+LastEA
)

 

vyohuamsft_1-1716448516254.png

 

Put them in the view:

vyohuamsft_2-1716448554564.png

Regarding how to change the line to Dotted line, you can find Line in format and change the format of the Forecast EA.

vyohuamsft_3-1716448693079.png

 

How to Get Your Question Answered Quickly 

Best Regards

Yongkang Hua

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
avatar user
Anonymous
Not applicable

Syndicated - Outbound

@v-yohua-msft I posted message regarding what I'm facing based on your solution but my post isn't posting at all.

@v-yohua-msft Thanks for your reply. It didn't work.
I know it is my fault for not explaining properly my tables replationship
Below is the data model / relationship and dataset that is similar.

 

tek01_0-1716886660136.png

 

ProcessTable

 

 

 

 

 

Company

Reporting_Date

ProcessName

EA

ACWP

Planned

A

01/04/2023

Shredding

1668

1618

1868

B

01/04/2023

Cutting

600

550

800

C

01/04/2023

Painting

500

450

700

A

01/05/2023

Shredding

1800

1750

2000

B

01/05/2023

Cutting

700

650

900

C

01/05/2023

Painting

550

500

750

A

01/06/2023

Shredding

2000

1950

2200

B

01/06/2023

Cutting

800

750

1000

C

01/06/2023

Painting

590

540

790

A

01/07/2023

Shredding

2200

2150

2400

B

01/07/2023

Cutting

900

850

1100

C

01/07/2023

Painting

600

550

800

A

01/08/2023

Shredding

2400

2350

2600

B

01/08/2023

Cutting

1000

950

1200

C

01/08/2023

Painting

650

600

850

A

01/09/2023

Shredding

2600

2550

2800

B

01/09/2023

Cutting

1050

1000

1250

C

01/09/2023

Painting

700

650

900


Note Datetable is the normal and continuous date but the one below shows by month.

DateTable

 

Date 

Period_MonthYear

01/04/2023

P1 Apr-23

01/05/2023

P2 May-23

01/06/2023

P3 Jun-23

01/07/2023

P4 Jul-23

01/08/2023

P5 Aug-23

01/09/2023

P6 Sep-23

01/10/2023

P7 Oct-23

01/11/2023

P8 Nov-23

01/12/2023

P9 Dec-23

01/01/2024

P10 Jan-24

01/02/2024

P11 Feb-24

01/03/2024

P12 Mar-24

01/04/2024

P1 Apr-24

01/05/2024

P2 May-24

01/06/2024

P3 Jun-24

01/07/2024

P4 Jul-24

01/08/2024

P5 Aug-24

01/09/2024

P6 Sep-24

 

CompayTable

Compay

A

B

C


I still want to achieve the Forecast EA as stated in my first question.
Please help me with the sample data i have typed in here.
Note- on my power bi canvas, when the line chart is displayed, there are Date Slicer (period_MonthYear) and Company Slicer 

v-yohua-msft
Community Support
Community Support

Syndicated - Outbound

Hi, @Anonymous 

First create a new measure to calculate the 6-month average of the ACWP:

Average ACWP = CALCULATE(AVERAGE('Table'[ACWP]), ALLSELECTED('Table'))

Then create an Index column in PowerQuery and create a new calculated column:

vyohuamsft_0-1716448484904.png

 

Forecast EA = 
VAR LastEA = CALCULATE(MAX('Table'[EA]), ALL('Table'))
VAR AvgACWP = [Average ACWP] / 6
RETURN 
IF('Table'[Index]>=6,SUMX(FILTER('Table','Table'[Index]<=EARLIER('Table'[Index])&&'Table'[EA]=BLANK()),AvgACWP)+LastEA
)

 

vyohuamsft_1-1716448516254.png

 

Put them in the view:

vyohuamsft_2-1716448554564.png

Regarding how to change the line to Dotted line, you can find Line in format and change the format of the Forecast EA.

vyohuamsft_3-1716448693079.png

 

How to Get Your Question Answered Quickly 

Best Regards

Yongkang Hua

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

avatar user

Helpful resources

Announcements
March PBI video - carousel

Power BI Monthly Update - March 2025

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

March2025 Carousel

Fabric Community Update - March 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors (Last Month)
Top Kudoed Authors (Last Month)