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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply

SUMX does not calculate at pivot aggregate level?

Hi everyone,

 

I am using the following formula, and I would like to calculate the ABS ERROR between the actuals and the forecast.

riccardoprade93_0-1669051137600.png

However, as you can see the it is not calculating at the pivot level. Shouldn't SUMX calculate the result at the aggregation provided in the Matrix? Why is not working?

 

Thanks a lot,

 

Riccardo

 

1 ACCEPTED SOLUTION

I created a varation of yours and it works.

 

ABSERR CNS = SUMX(SUMMARIZE('Dataset Agg','Dataset Agg'[SHIP_FROM],'Dataset Agg'[SUB_DIV],'Dataset Agg'[Period]),[ABS CNS])

View solution in original post

10 REPLIES 10
Anonymous
Not applicable

Hi @riccardoprade93 

I am so glad to hear that your problem has been fixed , please consider Accept it as the solution to help the other members find it more quickly. 

 

Best Regards,
Community Support Team _ Ailsa Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

tamerj1
Super User
Super User

Hi @riccardoprade93 

the screenshot is not clear from my end. I guess I have a technical issue. Would you please copy/paste the code and write down the nsmes of the two columns used in the matrix visual? Are they from the same table?

Both Actuals and Forecast are two column of the table behind standing.

 

You can see below, in the second table the disaggregated data, that is why it calculate the ABS ERROR as 2,006.00

the DFU is the lowest disaggregation in my table.

 

riccardoprade93_2-1669054223470.png

 

is there a way to compute the ABS ERROR at aggregated level easily?

 

Riccardo

@riccardoprade93 

This how I see the screenshot from my end. Would you please write down the highlied formula and the names of the highlighted columns?

BEF7D9A8-7B23-4701-B0AB-89A6BD64EFB3.jpeg

PeriodSHIP_FROMActualsForecastABSERROR V3 2
P09-22        EC9052A.61/1130              2006            2006              2006

 

ABSERR V3 2 = (SUMX('Dataset Agg'ABS('Dataset Agg'[Forecast]-'Dataset Agg'[Actuals])))
 
it does not sum to 0, because SHIP_FROM is an aggregation of the behind standing 'Dataset Agg' table.

@riccardoprade93 

Please try

ABSERR V3 2 =
SUMX (
SUMMARIZE ( 'Dataset Agg', 'Dataset Agg'[Period], 'Dataset Agg'[SHIP_FROM] ),
CALCULATE (
SUMX ( 'Dataset Agg', ABS ( 'Dataset Agg'[Forecast] - 'Dataset Agg'[Actuals] ) )
)
)

I created a varation of yours and it works.

 

ABSERR CNS = SUMX(SUMMARIZE('Dataset Agg','Dataset Agg'[SHIP_FROM],'Dataset Agg'[SUB_DIV],'Dataset Agg'[Period]),[ABS CNS])

nah, not working. It also gives me 2006. 

 

Because the SUMX it is summing at lower level. What I don't understand is how to sum at pivot aggregation.... 

AlexisOlson
Super User
Super User

The SUMX iterates over every row in the 'Dataset_Agg' table, not necessarily whatever rows you have showing in your pivot table. For each row in that table, it calculates the measure [Forecast] (converting the table row context to filter context via context transition) and takes the absolute difference between that measure and the table column 'Dataset_Agg'[Actuals].

 

How is the [Forecast] measure defined?

Both Actuals and Forecast are two column of the table behind standing.

 

You can see below, in the second table the disaggregated data, that is why it calculate the ABS ERROR as 2,006.00

the DFU is the lowest disaggregation in my table.

 

riccardoprade93_1-1669054084821.png

is there a way to compute the ABS ERROR at aggregated level easily?

 

Riccardo

 

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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