Quantcast
Channel: Desktop topics
Viewing all articles
Browse latest Browse all 213819

Calculate then Aggregate

$
0
0

Hi, 

 

I'm trying to find a way to keep a calculation on a detailed grain and once it's done on this level then aggregate it (SUM) the rest of the way to the top.

 

The formula is basically a X*Y (different grains though) and this works fine on the lowest level - so far so good.

 

Now I want to sum these results (eg. a total for all customers) and this results in 0 because the Y on this level is 0 - makes sense to me. Hence I want to CALCULATE (on product and customer level) first then AGGREGATE the calculated result in stead of "just" calculating it on Customer.

 

My table looks something like this:

Calculation (X and Y Values are Measures)
CustomerProductY ValueX ValueCurrent ResultDesired Result
111011010
212024040
31-303-90-90
12542020
221055050
32-156-90-90
13-157-105-105
23-308-240-240
33459405405
      
Aggregations
CustomerProductY ValueX ValueCurrent ResultDesired Result
1 0120-75
2 0150-150
3 0180225
 1060-40
 20150-20
 3024060

I've tried to use this formula:

SUMX(

  SUMMARIZE(

     Customer;

     Product);

     X*Y)

 

This results in 0 in all levels (both higher and lower grain).

 

I can find plenty resources explaining how I aggregate then calculate - but not calculate then aggregate.

Hope anyone can help out - it will be greatly appreciated.

 

Kind regards,

J.


Viewing all articles
Browse latest Browse all 213819

Trending Articles