Slicer Time Dimension Issue with Cube Functions


New Member
Sep 15, 2014

Hoping someone can help me figure out right approach here.

Using Excel 2013 connected to a SSAS cube as data source, and cube functions with slicers to create a dashboard.
Have following time dimension slicers; Fiscal Year, Fiscal Quarter, Fiscal Month, Fiscal Week & Date, that are used to slice data based on user selection, along with a sales measure.
Below is example of Slicer name and CubeMember function for each:

Slicer_Fiscal_Year: =CUBEMEMBER("Cube","[Date].[Fiscal Year].&[2015]")
Slicer_Fiscal_Quarter: =CUBEMEMBER("Cube","[Date].[Fiscal Quarter].[All]")
Slicer_Fiscal_Month: =CUBEMEMBER("Cube","[Date].[Fiscal Month].&[201408]")
Slicer_Fiscal_Week: =CUBEMEMBER("Cube","[Date].[Fiscal Week].&[201509]")
Slicer_Date: =CUBEMEMBER("Cube","[Date].[Date].[All]")

What I am trying to do is to build a table that takes the lowest grain of the slicer time dimension selected, shows the current member, plus the prior 7 so I can have an 8 period trending view table that I will build a chart from. In the above example that would mean that it would look at Slicer_Fiscal_Week since that is lowest grain that has an attribute other than All, and then show me the prior 7 periods. In this case 201509 means Week 9, so I would want to show in table Week 9 back to Week 2. But if Slicer_Fiscal_Week was set to All, along with Slicer_Date, then Fiscal Month would be lowest grain, so I would want to show Fiscal Months from August (201408) back to January 2014. I know how to use CubeRankedMember to pull the value from what is selected in the slicer, the problem is figuring out how to pass the lowest grain time dimension so that I can use lag or some other MDX function to get the previous periods.

Any help on this would be greatly appreciated.

Some videos you may like

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)


Board Regular
Apr 29, 2014
I see two possible solutions

1) have a look a the dynamic charting method
Dynamic Charting In Power Pivot « PowerPivotPro

2) Excel workaround

build a 8-column-table with all periods (dates,weeks,month... all in one list) and the related period -7, -6- ...

Use CUBERANKEDMEMBER to find out what is selected and on what level you are. You need to get the member from the lowest level that does not show "all" in one cell.
In my Cube Year, Quarter, Month are in one hierarchy so even that I see 3 slicer its only one slicer_period behind and CUBERANKEDMEMBER exactly shows me that member (e.g. FY15 Q1 if Q1 is selected and Month is on All).
In your case slicer seem to be independend and you would need some If statements to find out on what level you are --> IF(CUBERANKEDMEMBER("Cube",Slicer_Date;1)<>"All";CUBERANKEDMEMBER("Cube",Slicer_Date;1); IF(CUBERANKEDMEMBER("Cube",Slicer_Week;1)<>"All";......

Now create a VLOOKUP to your period table to pull the members for period -1 to period - 7 that you can use for your CUBEVALUE formulas

Watch MrExcel Video

Forum statistics

Latest member

This Week's Hot Topics