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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
U382911
Frequent Visitor

Calculating YTD absolute error and YTD average abs error

Hello all,

Hoping for some assistance with this effort. I have the below matrix example, calculating the absolute error of forecast vs sales by product family by month:

 

U382911_0-1694718094626.png

I'm trying to calculate the YTD abs error and YTD average absolute error - so going from top to bottom (Cube to Sphere) for February I would expect the YTD avg abs error to be 11.02, 31.965, 42.99, and 132.28 respectively, and March would start off with 9.55 for Cube (avg of 11.02 for Jan + 11.02 for Feb + 6.61 for March), and so on.

 

I'd additionally like the YTD abs error value to be the sum of each month's abs error, rather than recalculating it monthly based on the sum of the FC and sales. (So, for example, March's YTD abs error for Cube would be 11.02+11.02+6.61 = 28.65, not the sum of orders from Jan-Mar (22.05+33.07+26.46) - the sum of FC from Jan-Mar (11.02+22.05+33.07) = 15.44).

 

I've attached a GDrive link to the example pbix for examination - please go easy on my limited DAX knowledge at this point. Help 

2 REPLIES 2
U382911
Frequent Visitor

Thank you. For the monthly buckets, this works perfectly. However, it doesn't appear to be totaling correctly. 

U382911_0-1695130659718.png

Is there an easy change to the formula or another measure to correct this?

 

Link to updated pbix file: https://drive.google.com/file/d/10mzPDK4dzcV3nx3CIJXt90EFSTRkR73q/view?usp=drive_link 

amitchandak
Super User
Super User

@U382911 , For ytd you can use time intelligence using date table

 

YTD Sales = CALCULATE(SUM(Table[error]),DATESYTD('Date'[Date],"12/31"))

 

for error

 

YTD Sales = CALCULATE(Averagex(Values(Date[Month Year]), calculate( SUM(Table[error]))) ,DATESYTD('Date'[Date],"12/31"))

 

 

Power BI — Year on Year with or Without Time Intelligence
https://medium.com/@amitchandak.1978/power-bi-ytd-questions-time-intelligence-1-5-e3174b39f38a
https://www.youtube.com/watch?v=km41KfM_0uA

 

Time Intelligence, Part of learn Power BI https://youtu.be/cN8AO3_vmlY?t=27510
Time Intelligence, DATESMTD, DATESQTD, DATESYTD, Week On Week, Week Till Date, Custom Period on Period,
Custom Period till date: https://youtu.be/aU2aKbnHuWs&t=145s

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

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.