i have following formula to find the average of top 2 sales in each city
AvgTopSales:=AVERAGEX(topn(2,summarize(ALL(Table1),Table1[Parlour],"TotSales",[Tot])),[TotSales])
currently my pivot table look like as below. in city1 i am supposed to get 1646.5 (avg of 1978 &1315)
but above formula returns 1527 for all store/city
Row Labels Tot AvgTopSales
CIty 1
Store1 1978 1527
Store10 1169 1527
Store4 821 1527
Store7 1315 1527
CIty 2
Store11 2013 1527
Store2 1076 1527
Store5 2114 1527
Store8 1028 1527
CIty 3
Store12 715 1527
Store3 1812 1527
Store6 2256 1527
Store9 1459 1527
Grand Total 17756 1527
AvgTopSales:=AVERAGEX(topn(2,summarize(ALL(Table1),Table1[Parlour],"TotSales",[Tot])),[TotSales])
currently my pivot table look like as below. in city1 i am supposed to get 1646.5 (avg of 1978 &1315)
but above formula returns 1527 for all store/city
Row Labels Tot AvgTopSales
CIty 1
Store1 1978 1527
Store10 1169 1527
Store4 821 1527
Store7 1315 1527
CIty 2
Store11 2013 1527
Store2 1076 1527
Store5 2114 1527
Store8 1028 1527
CIty 3
Store12 715 1527
Store3 1812 1527
Store6 2256 1527
Store9 1459 1527
Grand Total 17756 1527