Sql-server – Drillthrough action on semi-additive measure group

sql serverssasssdt

I have created a semi-additive (Last Non-empty) measure in a cube that I am developing. For that measure group I have created a drillthrough action. When I use that drillthrough action it is returning not just one row for each item as I would expect, but one row for each item for each date, as though it is not recognizing that the measure is semi-additive.

The same issue is mentioned in a couple of Microsoft Connect articles from 2009 here and here, but there is no comment on how to resolve the issue, and I've found very little else on this problem.

I'm using SQL Server 2012 Enterprise.

Is there a solution or a work-around for this problem?

Best Answer

Assuming it is SSAS Multidimensional you can deploy ASSP and build a rowset action which returns the right rows. The rowset action expression would be something like:

ASSP.GetDefaultDrillthroughMDX(Tail(NonEmpty(Existing [Date].[Date].[Date].Members), 1).Item(0))

To explain that code, we get the existing dates (the dates in context of the current cell) then we filter down to only dates with a non empty value for the current measure (inheriting all the other filters on the current cell) then find the most recent date.

More info on this stored procedure can be found here: http://asstoredprocedures.codeplex.com/wikipage?title=Drillthrough&referringTitle=Home

Note a rowset action can't be the double click drillthrough action in Excel unfortunately. You will have to expose your action when users right click on the cell and choose Additional Actions.

Excel has a double click behavior. Double click performs a drillthrough returning either the default columns or returning the columns you define in the drillthrough action you define for that measure group as default. If I execute a DRILLTHROUGH SELECT statement manually without specifying the columns I want then I will get back the columns defined in the drillthrough action flagged as the default