Forum Discussion
Top 10 Values with Running Total
- 7 years ago
Hi venug20
try this, first create another measure for top10 sales, I named it top10sales, reason I added this new measure because total line of top10 items is not showing correctly:
Top10Sale2 = var myRank = [Rank] RETURN SUMX( VALUES(bi_product[Product]), IF(myRank <=10, [Top10Sale] ) )
We will use top n to get the list of products based on rank and then sum it up, if condition is to avoid showing all the product and remove running total in the "total" line of the table.
Top10RunningTotal = IF( [Rank] <= 10 && HASONEFILTER( bi_product[Product] ), CALCULATE( [Total Sales], TOPN( [Rank], ALL(bi_product[Product] ), [Total Sales] ) ) )
Hope it is helpful,you can take it from here.
Hi venug20
try this, first create another measure for top10 sales, I named it top10sales, reason I added this new measure because total line of top10 items is not showing correctly:
Top10Sale2 = var myRank = [Rank] RETURN SUMX( VALUES(bi_product[Product]), IF(myRank <=10, [Top10Sale] ) )
We will use top n to get the list of products based on rank and then sum it up, if condition is to avoid showing all the product and remove running total in the "total" line of the table.
Top10RunningTotal = IF( [Rank] <= 10 && HASONEFILTER( bi_product[Product] ), CALCULATE( [Total Sales], TOPN( [Rank], ALL(bi_product[Product] ), [Total Sales] ) ) )
Hope it is helpful,you can take it from here.