Modifying This to Work With Your Existing Workbook Isn’t Hard
Given the continued popularity of the Calendar Chart and the post I did on its anatomy, I thought I’d continue today with a more pragmatic “how do I adapt this to work with my data?” post.
Adding the Calendar Chart to YOUR PowerPivot Workbook
OK, so you like the calendar chart but you don’t want to start from scratch in a new workbook? You already HAVE a PowerPivot workbook and want to just “port” the calendar chart into THAT workbook?
It’s easy. Probably a 30 minute task, and that includes the time spent reading this post.
Just select all four sheets in my workbook (which you can download here), right click, select Move or Copy:
Copying Report Sheets (Pivots and Cube Formulas)
From One PowerPivot Workbook to Another is Simple
This is actually a very handy technique in general. You have pivots in one workbook that you want to use with the PowerPivot model in another workbook? Just copy the sheets over.
As long as the names of tables, columns, and measures are the same in both PowerPivot workbooks, this goes great.
Of course, in this case, chances are that none of that is true – all of your stuff is named differently. So you’ll get lots of errors. Not to worry!
***TIP: I recommend briefly reading this entire post first, before stepping through it with your own workbook.
***DISCLAIMER: I must admit that I haven’t had time (yet) to run through all of the steps myself. I fully expect there’s a minor “hiccup” or two here somewhere – if so please report your experience in the comments.
Changing the CalGrids to use YOUR Measures
I’m gonna go out on a limb and say that you probably don’t have measures named things like Sightings and Abductions.
Let’s say you have three measures named [Sales], [Units], and [Growth].
Just type those three names into Excel somewhere, in a single column. Copy them, then on the MeasureSelector table in PowerPivot, click Paste Replace:
Now this table contains this:
Back in Excel, a Refresh All on the Data tab will result in the “Show Me…” slicer giving you just those choices:
Important: the captions on those slicers must EXACTLY match the names of your measures (minus the square brackets) or this won’t get you very far.
There is one last place where you have to fix up measures, and that’s in cell F6 on the report sheet itself:
Replace [Sightings] with the the name of your measure, like [Sales]
That is the “default” measure to display in the report, which is used when someone selects more than one measure on the “Show Me” slicer.
Matching the Calendar
With the measures fixed up, now you have to make the Calendar match up.
You Can DO IT!
You can rename your Calendar table and all of its columns to match mine of course . That actually might be the lowest friction path.
But if you don’t want to do that, no problem. Just go the HiddenSets sheet, there are a few cells you need to modify:
The HiddenSets Sheet Contains All the Formula References to Calendar Table
Slicer Surgery – the two purple highlighted cells contain references to slicers named Slicer_Year and Slicer_MonthNum – those are the slicers on the report sheet itself. Right now those slicers are connected to columns that may not exist in your model, so there’s a problem there.
Add two new slicers against your equivalent columns and then change these formulas to reference the new slicers. The name of your slicer is NOT the same as the caption. You can get the name out of the Slicer Settings dialog (accessible from the ribbon when a slicer is selected):
This is the Name Used to Reference a Slicer in a Formula
Two Measures in the Calendar Table
You’ll need to make sure you add at least these two measures:
Make Sure You Have These Two Measures and
They Are Named EXACTLY the Same As I Named Them
Those are both very simple formulas, not hard to add to your model.
That Sparkline Pivot, Grrr…
OK, there’s also a pivot on the HiddenSparklineSource sheet, and I’m pretty sure that’s going to be in an unhappy state after all of these changes.
I don’t have time to dig into that today, so I’m going to end here. I’m on vacation actually, I’m gonna take a pass.
But if anyone is interested in writing a guest post on the sparkline sheet, let me know
Modifications and Variations?
If you’re adapting this to use against your data, I’d love to hear from you. I’m rob. At a place called Pivotstream. Dot com. Or leave a comment.