DirectSlice and MeasureExpression: the bug is not a bug

A few months ago I wrote about a possible bug using both DirectSlice and MeasureExpression. A few days ago, Edward Melomed answered that the behavior we observed was not a bug but by design: you can read the complete answer on Connect.

The key point is this sentence, that I don’t remember has been documented before (and the real reason for this post):

DirectSlice is an optimization that is supposed to take care of the case where there is a default member on a coordinate for which the user guarantees that the results with and without the MeasureExpression are the same. […] But the requirement is that the application of the MeasureExpression should give the same result as without the expression for that coordinate.

In other words, I was assuming that DirectSlice had the precedence over any MeasureExpression value, and this is not the case. DirectSlice is just an optimization, and you cannot use it to change the semantic of the formula defined in MeasureExpression.

Article written by
Post originally appeared on:
 Enclose code in comments with <PRE></PRE> to preserve indentation.