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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
danb
Resolver I
Resolver I

Forecast values in table from Line Chart forecast

Good afternoon experts, I have been trying to track down the answer here without luck so figured I would just post and hopefully someone can point me in the right direction. I am trying to put together a forecast based on actual case sales for the previous year. I have the forecast applied to the line chart but would also like to have the forecast values present in a table in the same PBI report. Am I stuck having to write a DAX measure(s) to recreate that in a table or is there a work around? 

danb_0-1656355803848.png


Here is the test dataset

Month/Year NetCases 
5/1/2021 0:00  3,321,610.32
6/1/2021 0:00  3,334,801.74
7/1/2021 0:00  3,439,256.00
8/1/2021 0:00  3,143,754.72
9/1/2021 0:00  2,975,006.23
10/1/2021 0:00  3,097,979.57
11/1/2021 0:00  3,289,371.60
12/1/2021 0:00  3,300,790.02
1/1/2022 0:00  2,708,015.26
2/1/2022 0:00  2,836,285.04
3/1/2022 0:00  3,356,680.70
4/1/2022 0:00  3,065,062.20
5/1/2022 0:00  3,140,745.66


Thanks and sorry again if this is already answered elsewere. 

Danb

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

Hi @danb ,

 

Am I stuck having to write a DAX measure(s) to recreate that in a table or is there a work around? 

Yes, you will need to create a measure. And in my workaround, you need to create a new table with whole MonthYear like:

New Table = 
var _t=ADDCOLUMNS( FILTER( CALENDAR(EDATE( MAX('Table'[Month/Year]),1), EDATE( MAX('Table'[Month/Year]),12) ),DAY([Date])=1),"NetCased",BLANK())
return UNION('Table',_t)

Eyelyn9_0-1656567766530.png

Then I used average value as the forecast value for future dates:

Foreast (Average) = IF(SUM('New Table'[NetCases])=BLANK(), CALCULATE(AVERAGE('Table'[NetCases]),FILTER('Table', MONTH([Month/Year])=MONTH(MAX('New Table'[Month/Year])))) ,  SUM('New Table'[NetCases]))

Output:

Eyelyn9_2-1656567936983.png

 

 

Best Regards,
Eyelyn Qin
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
v-eqin-msft
Community Support
Community Support

Hi @danb ,

 

Am I stuck having to write a DAX measure(s) to recreate that in a table or is there a work around? 

Yes, you will need to create a measure. And in my workaround, you need to create a new table with whole MonthYear like:

New Table = 
var _t=ADDCOLUMNS( FILTER( CALENDAR(EDATE( MAX('Table'[Month/Year]),1), EDATE( MAX('Table'[Month/Year]),12) ),DAY([Date])=1),"NetCased",BLANK())
return UNION('Table',_t)

Eyelyn9_0-1656567766530.png

Then I used average value as the forecast value for future dates:

Foreast (Average) = IF(SUM('New Table'[NetCases])=BLANK(), CALCULATE(AVERAGE('Table'[NetCases]),FILTER('Table', MONTH([Month/Year])=MONTH(MAX('New Table'[Month/Year])))) ,  SUM('New Table'[NetCases]))

Output:

Eyelyn9_2-1656567936983.png

 

 

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

@v-eqin-msft  - thank you for the response and the solution. Works great! 

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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