Filter by measure value

Is it possible to filter the value of a measure? In my scenario, I need to limit the widget population to [Measures]. [Returned Widget Count], which is 1 or 0, only where Measure = 1. For example, something like this:

    Select  {
            (
            [Dim Widget].[Build Site].[The Moon],
            [Dim Date].[Build Day].[2012-04-24],
            [Measures].[Widget Count]
            ),
            (
            [Dim Widget].[Build Site].[The Moon],
            [Dim Date].[Build Day].[2012-04-24],
            [Measures].[Returned Widget Count]
            )
            }   on 0
    from    (
            Select  [Dim Widget].[Build Site] on 0
            From    [Widgetizer]
            Where   Filter(
                    [Dim Widget].[Serial Number].Members,
                    [Measures].[Returned Widget Count].Value > 0
                    )
            )

The request is being executed, but it does not filter my population. I know this because it returns the same result as:

    Select  {
            (
            [Dim Widget].[Build Site].[The Moon],
            [Dim Date].[Build Day].[2012-04-24],
            [Measures].[Widget Count]
            ),
            (
            [Dim Widget].[Build Site].[The Moon],
            [Dim Date].[Build Day].[2012-04-24],
            [Measures].[Returned Widget Count]
            )
            }   on 0
    from    [Widgetizer]

If the filter function has not even been applied.

How can I reduce the population to ONLY where the measure is a specific value?

+3
source share
1 answer

I think Filter is working correctly. The problem may be the contents of the hierarchy (?) [Dim Widget]. [Serial number] - if you have a member [All], and the following filter will also select it:

([Dim Widget]. [ ].Members, [Measures]. [Returned Widget Count].Value > 0)

, . :

([Dim Widget]. [ ].Members, [Measures]. [Returned Widget Count].Value = 1)

+2

All Articles