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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

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
v-yetao1-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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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

Top Solution Authors