Get Timeline Slicer date range for inclusion in graph title

LGXSteve

New Member
Joined
Sep 1, 2015
Messages
7
I have a pivot table (derived from PowerPivot) that displays data filtered by a Timeline Slicer. The Pivot table is then represented in a Pie Chart which has a title. Is there any way I can link the title to the Timeline Slicer range, so it indicates the date range for which the pie chart is valid. I suspect some VBA may be required, but it is a v. long time since I did any VBA, and never with PowerPivot.

(I am using Excel 2013)

Thanks in anticipation
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
I prefer 2 simple vba functions:

VBA Code:
Public Function TimelineStart(strTimelineName As String) As Date
    TimelineStart = ActiveWorkbook.SlicerCaches(strTimelineName).TimelineState.StartDate
End Function

Private Function TimelineEnd(strName As String) As Date
    TimelineEnd = ActiveWorkbook.SlicerCaches(strTimelineName).TimelineState.EndDate
End Function

You can get the slicer names from the names collection (Ctrl+F3)
 
Upvote 0
I did it this way to avoid having to use any VBA:


(Create a second copy of the pivot table; then make the 2nd pivot table display only the min and max dates from the dates field and use those in your formulae)
 
Upvote 0

Forum statistics

Threads
1,223,630
Messages
6,173,450
Members
452,514
Latest member
cjkelly15

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top