cancel
Showing results for 
Search instead for 
Did you mean: 
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
Ailsa-msft
Community Support
Community Support

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
Carousel_PBI_Wave1

2023 Release Wave 1 Plans

Power BI release plans for 2023 release wave 1 describes all new features releasing from April 2023 through September 2023.

Power BI Dev Camp Session 30

Ted's Dev Camp - January 26, 2023

This session will provide guidance and teach campers the skills required to build Power BI reports that support multiple languages.

Power BI Summit Carousel 2

Global Power BI Training

Make sure you register today for the Power BI Summit 2023. Don't miss all of the great sessions and speakers!

Thank you 2022 Review

2022 Monthly Feature Releases

We had a great 2022 with a ton of feature releases to help you drive a data culture.

Top Solution Authors
Top Kudoed Authors