This is a companion post to Grouping Lower Ranked Bars in Bar Chart. We will use most of the same calculated fields.
Step 1. Create an integer parameter [Top N].
Step 2. Drag [Country / Region] to Details shelf and sort it by Sum(Sales) in descending order.
Step 3. Create a [Top N+1 Rows] filter:
- Index()<=[Top N] +1
Step 4. Select mark type to be Pie chart.
Step 5. Create [Top Countries & Others]. This will alias the country at the (N+1)th position to be "Others". Drag it to Color shelf and Label/Text shelf and set it to Compute using> [Country / Region].
- If Index()=[Top N] +1
- Then "Others"
- Else Attr([Country / Region])
- End
- If Index()=[Top N] +1
- Then Window_Sum(Sum(Sales),0,Last())
- Else Sum(Sales)
- End
That's it! The workbook can be found here.
Top N & Grouping Others Series
No comments:
Post a Comment