Exploring Excel 2013 for BI Tip #13: Connecting Slicers in Pivot Tables Sourced from a Power Pivot Model

17 12 2013

As I mentioned in my original post, Exploring Excel 2013 as Microsoft’s BI Client, I will be posting tips regularly about using Excel 2013.  Much of the content will be a result of my daily interactions with business users and other BI devs.  In order to not forget what I learn or discover, I write it down … here.  I hope you too will discover something new you can use.  Enjoy!

The Issue

At Magenic’s Code Mastery event in Boston, Stevo Smocilac and I were presenting on Power BI and Tabular Models. After our presentations, one of the attendees presented an issue to us about how he was unable to get a slicer to filter two separate pivot tables in his workbook. This will be the third tip on slicers as we investigate this issue to find a resolution. (Tip #4: Adding a Slicer and Tip #5: Cleaning Up Slicers)

To reproduce the issue, you will need to create a Power Pivot model with two related tables. In neither case will we have calculations. The primary table in my illustration is the Poll table with two fields PollID and PollQuestion. Create a flattened pivot table from the Power Pivot window as shown below.

image

Now that I have the Power Pivot connection and the pivot table ready to design in the workbook, I added the PollID and PollQuestion fields to the pivot table. Next, turn off subtotals for all fields. The next step is to add the slicer for the PollID.

Once all this is complete, we need to add another pivot table. In my case, I can use the PollOption table which has each of the valid options for each poll, essentially a clean one-to-many relationship that was built into the Power Pivot model. I added the next pivot table to the worksheet using the following steps:

1. From the Insert tab on the ribbon, select Pivot Table

image

2. In the dialog that opens, select “Use an external data source” and click “Choose Connection.”

image

3. Select the Power Pivot model as your source and click Open. Then select OK on the next dialog. This will result in another pivot table which shares the Power Pivot model as the source.

image

Once you have the new pivot table add the columns from the related table. In my worksheet I selected the PollID and OptionText from the Poll Option table. The final step to reproduce the issue is to relate the existing slicer to the the new pivot table. This is done by right-clicking the slicer box and choosing the Report Connections option. From here you can add the new pivot table to the Slicer connections.

Now that this is set up, when you click a slicer option, it filters the first table, but not the second as shown here:

image

As you can see the first table filtered correctly, but not the second.

Solving the Issue

It turns out the solution is fairly straightforward, but not something you would normally think of. If you add an aggregation to the related table, Poll Option, then the slicer works just fine.

image

It does not seem to matter what is aggregated, but an aggregation is required. While I was unable to find any reason why, my best guess is that this is related to the fact that pivot tables still communicate with Power Pivot models using MDX. I have seen this happen when working with multidimensional models where you needed a value in order to get the slicer or filter to work correctly, even in MDX itself.

While this solves the problem, we are now left with a column we did not want on the pivot table. It would appear that the only option we have to make the column not appear is to hide the column. However you will need to tread carefully here as it hides the column for all tables below as well.





Exploring Excel 2013 for BI Tip #5: Cleaning Up Slicers

29 03 2013

As I mentioned in my original post, Exploring Excel 2013 as Microsoft’s BI Client, I will be posting tips regularly about using Excel 2013.  Much of the content will be a result of my daily interactions with business users and other BI devs.  In order to not forget what I learn or discover, I write it down … here.  I hope you too will discover something new you can use.  Enjoy!

Cleaning Up Slicers

In this tip, a follow up from Tip 4 on adding slicers, I wanted to highlight a couple of ways to clean up your slicers to make them more user friendly.

The focus here is around Slicer Settings which can be opened from the short cut menu on the slicer or in the SLICER TOOLS ribbon option as shown below.

image

This will open the Slicer Settings dialog.  The image below shows the setting for my Age Range slicer with the slicer.  The settings you see are the default settings.

image

So how can you change this to be better for the user.  You may need to change the Caption to reflect something better for the users.  You can also remove this if the content in the slicer is self-explanatory.

Next, check your sorting.  If you have the data sorted correctly, use it.  However, you can also do typical alpha sorting. Be aware, that you may have issues with data types like dates or numbers if they are not ready for this type of sort.

The 3 check boxes are the most relevant.  The two selected by default should be used in general.  The next set of images show the visualization of the slicer based on these settings.  In this scenario, we only have data for the 30-39 option.

No options are selected:

image

This gives no visual cues to what data is available or not.  This is the least preferred as there is no clarity to the user.

image

The image above dims the options that have no data by selecting the “Visually indicate items with no data”.  This works great in a short list and you want to display options with no data.  Basically, knowing that no data exists is important to the user.

When you have more options, you can add the option to “Show items with no data last” which will move items with data to the top.  With longer lists this helps provide relevant data at the top of the list.

image

The final option will hide items with no data.  This is clearly preferred for potentially long lists.  My favorite usage for this option is to use this with dates.  This will allow me to source only dates with data for filtering use.  Here is what our list looks like with the “Hide items with no data” option selected.

image

This option is really cool as slicers are interactive and will remove options as other slicers are selected.  I tend to use this a lot as it also saves real estate on the sheet when designing dashboards in Excel.








Follow

Get every new post delivered to your Inbox.

Join 787 other followers

%d bloggers like this: