Thank you for your reply, i did use you <Territory> and this work great in the pivot. But i still need to count the customers in this territory that fall in the bracket of 80% for instance. I wrote the expression with aggr and this sum the total correct but flag pareto field is not flagging the correct customers so the sum is calculating the wrong customers. Only customers that falls into the bracket of 80% must be flagged with a 1.
sum ( aggr ( If ( Rangesum ( Above ( sum ( [Sales Amount] ) ,0 , Rowno() )) / sum ( Total <Territory> [Sales Amount] ) <= v_Pareto_Persentage , 1 , 0) , Territory , Customer ))
Would appreciate help.
No I had understood what the Flag.
If( RangeSum(Above(Sum([Sales Amount]), 0, RowNo())) / Sum(TOTAL <Territory> [Sales Amount]) <= v_Pareto_Percentage,
But I recommend you use:
If([% Sales Cumulated] <= v_Pareto_Percentage,1,0)
The Aggr is useful in to calculated dimension, but this field is not an dimension, is an expression field.
I hope, it is that you need.
I have tried your suggestion of if ([% Sales Cumulated] <= v_Pareto_Percentage, 1, 0) but i am still looking for the correct total of Flag Perto for the territory in the pivot.
In the screenshot you posted the total of field Flag Pareto in territory north must be 2 and the south must be 4. That is why i was trying to use the Aggr
Thank you for your help