| Row Selection Using Slicers in PowerPivot - Part 2 |
| Written by Jason Thomas | |||
| Thursday, 17 January 2013 17:21 | |||
|
Reposted from Jason Thomas blog with the author's permission. This post is a continuation of the Row Selection Using Slicers in PowerPivot – Part 1 (so it might be a good idea to read that post before this). In our last post, we discussed the basic solution pattern for row selection using slicers in PowerPivot. In this post, we will discuss two other scenarios which are slightly more complex but still uses the same pattern. Scenario III - GroupNames in multiple dimensions 1) As per the solution steps, we first have to create the Group table Note that we need two grain columns here, as the GroupNames belong to two dimensions – Product and Customer. The GroupName will be Customer and Product, and the GroupValues will be the actual product or customer values depending on the GroupName. As with the previous posts, I use MS Query to generate this table.
2) Add this new table (Group) to the data model and then relate the Product & Customer column in this table to the ProductKey column in the Product table & CustomerKey column in the Customer table. 3) Hide the original measure Sales, and then create a new measure with the formula given below
4) Check out the results by creating a pivot table with GroupValue on the rows, NewSales on Values and GroupName in Slicers. Download the Excel 2013 file with the solution from here. Scenario IV – Hybrid Scenario 1) As usual, the first step is to generate the Group table. Note that even though we have only 4 subcategories, we end up with 6 rows because we will have to ensure that the grain is at a Product and Customer level. Similarly, we end up with 9 rows for Promotions when we convert the granularity of the Promotions table from just Product to the Product and Customer level. Find below the MS Query way of generating this table
2) Add this new table (Group) to the data model and then relate the Product & Customer column in this table to the ProductKey column in the Product table & CustomerKey column in the Customer table. 3) Hide the original measure Sales, and then create a new measure with the formula given below
Also note the use of the Promotions table (which is the many to many table) in the filter part of the calculate statement. 4) Check out the results by creating a pivot table with GroupValue on the rows, NewSales on Values and GroupName in Slicers. Download the Excel 2013 file with the solution from here. With that, we come to the end of this 2 part series on how to change the rows using slicers in PowerPivot. As you would have seen, the bulk of the work lies in generating the Group table and the rest is pretty simple. Hope these scenarios will help you in case you ever need to do the same.
|








