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!
Adding Calculated Members to the Excel 2013 Workbook
In my last tip (#8), I discussed using calculated measures. In this tip, I will talk about creating a calculated member. The primary difference is that a member becomes a part of a dimension and can be used as a filter, column header, row header, or even a slicer.
In my simple example, I want to created an aggregated set of categories used in my polls called “Cool Cats” which contained the Fun, Entertainment, and Sports categories and puts my new member in the Poll Category attribute hierarchy. I will use this to see how many submissions there were in these categories.
As before, you can create and manage calculated members from the ANALYZE tab in the PIVOTTABLE TOOLS ribbon. Use the OLAP Tools menu and select the MDX Calculated Member option. If you have already created the member, use the Manage Calculations option to edit existing members and measures.
The New Calculated Member dialog is different from the dialog used to edit the member. Let’s start with the create dialog as noted below.
(1) Assign your measure a name. It will have to be unique in the context of the the Parent Hierarchy.
(2) Assign the Parent Hierarchy and Parent Member. This establishes where you plan to locate the new member. As you can see you can choose any hierarchy you use in your cube. The Parent Member property lets you choose that first level within the hierarchy. In my case, I am choosing the Poll Category attribute hierarchy and the All member as the parent.
(3) Create your member with MDX. Because you are creating a member, it is important that your MDX resolves to a member. As a side note I used a set initially which passed the Test MDX operation, but displayed as #VALUE in Excel.
(4) Test MDX will allow you verify you have no syntax errors in your member creation. However, as I noted in step 3 it is not flawless, so you may still have issues even though it is valid syntax.
A couple of important concepts. In my situation, the Cool Cats member stopped at the top level. If I put this in the Category hierarchy which has multiple levels, Cool Cats would have no children as it is a stand alone member. However, when applied at a filter level it will filter results properly. The image below shows the filter in use.
Now when I pull the Poll Category hierarchy into the pivot table you will see that Cool Cats is a peer member and has the valid value. By default Excel will not calculate the Grand Total with those members twice.
You will need to be prepared to properly call this out for your users so the understand how calculated members operate in this scenario.
A common use case for creating calculated members is to create date members that aren’t easily created or tested. This will allow you to work out the member and how it affects the user experience.