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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
nleuck_101
Responsive Resident
Responsive Resident

Cumulative Forecast Totals not adding up

Hello All,

 

I'm having some trouble getting my Cumulative total to work correctly. I tried using the Enterprise DNA Youtube video for Create Automatic Forecasts From Historic Data in Power BI using DAX but it's not working as expected.


https://www.youtube.com/watch?v=vq3VOERJw7s

 

Measure to calculate Total that is used in the Forecast:

Total = SUMX(Table, Table[Column])

 

Here is my Forecast measure:

measure =
VAR TotalLM = CALCULATE([Total], DateTable[date_field] = DATE(YEAR(TODAY()), MONTH(TODAY())-1, 1))
VAR Total2MthsAgo = CALCULATE([Total], DateTable[date_field] = DATE(YEAR(TODAY()), MONTH(TODAY())-2, 1))
VAR Total3MthsAgo = CALCULATE([Total], DateTable[date_field] = DATE(YEAR(TODAY()), MONTH(TODAY())-3, 1))
VAR Total4MthsAgo = CALCULATE([Total], DateTable[date_field] = DATE(YEAR(TODAY()), MONTH(TODAY())-4, 1))
VAR Total5MthsAgo = CALCULATE([Total], DateTable[date_field] = DATE(YEAR(TODAY()), MONTH(TODAY())-5, 1))
VAR Total6MthsAgo = CALCULATE([Total], DateTable[date_field] = DATE(YEAR(TODAY()), MONTH(TODAY())-6, 1))
VAR Total7MthsAgo = CALCULATE([Total], DateTable[date_field] = DATE(YEAR(TODAY()), MONTH(TODAY())-7, 1))
VAR Total8MthsAgo = CALCULATE([Total], DateTable[date_field] = DATE(YEAR(TODAY()), MONTH(TODAY())-8, 1))
VAR Total9MthsAgo = CALCULATE([Total], DateTable[date_field] = DATE(YEAR(TODAY()), MONTH(TODAY())-9, 1))
VAR Total10MthsAgo = CALCULATE([Total], DateTable[date_field] = DATE(YEAR(TODAY()), MONTH(TODAY())-10, 1))
VAR Total11MthsAgo = CALCULATE([Total], DateTable[date_field] = DATE(YEAR(TODAY()), MONTH(TODAY())-11, 1))
VAR Total12MthsAgo = CALCULATE([Total], DateTable[date_field] = DATE(YEAR(TODAY()), MONTH(TODAY())-12, 1))
VAR Total13MthsAgo = CALCULATE([Total], DateTable[date_field] = DATE(YEAR(TODAY()), MONTH(TODAY())-13, 1))
VAR Factor = .0038

RETURN
DIVIDE(
TotalLM + Total2MthsAgo + Total3MthsAgo + Total4MthsAgo + Total5MthsAgo + Total6MthsAgo + Total7MthsAgo + Total8MthsAgo + Total9MthsAgo + Total10MthsAgo + Total11MthsAgo + Total12MthsAgo + Total13MthsAgo, 13, 0) * Factor
 
And then here is my Cumulative Total Forecast measure:
Cumulative Total Forecast = CALCULATE([Forecast], FILTER(ALLSELECTED(DateTable), DateTable[date_field] <= MAX(DateTable[date_field])))

But the results only show what the increase should be which is an increase of 17.

nleuck_101_0-1648648131417.png

What I should expect is Apr-2022 be 4578 and then May-2022 be 4595 and then June-2022 be 4612 and so on.

Any help would be greatly appreciated!

3 REPLIES 3
v-janeyg-msft
Community Support
Community Support

Hi, @nleuck_101 

 

Without data and context it's hard for me to determine where you're going wrong. You can check step by step which result is wrong by splitting the measure. If you can share some sample data and your calculation logic and your desired result, we can help you more accurately.

 

Best Regards,
Community Support Team _ Janey

amitchandak
Super User
Super User

@nleuck_101 , if you need 13 month avg of sum measure you can try a measure like

 

Rolling 13 = calculate(AverageX(Values('Date'[MONTH Year]),[Total] ),DATESINPERIOD('Date'[Date ],MAX('Date'[Date ]),-13,MONTH))

 

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

@amitchandak 

Unfortunately, that will not work for me. I need the Cumulative sum. I need the 17 to be added to Apr. Then May will be that total plus another 17 and so on.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors