Search code examples
mdx

Filtering by a subtotal of the measure


I have the following query in MDX:

SELECT {

    [Season].[Season].members *
    [Measures].[Wins]

} ON COLUMNS, {

    Filter([Team].[Name].[Name].members, [Measures].[Wins] > 100)

} ON ROWS

FROM [Nfl2]

enter image description here

Here I am filtering by "All Wins > 100". How would I filter by "Wins in 2012 > 10" ?


Solution

  • Use this code :

    SELECT {
    
        [Season].[Season].members *
        [Measures].[Wins]
    
    } ON COLUMNS, {
    
        Filter([Team].[Name].[Name].members, ([Season].[Season].&[2012],[Measures].[Wins]) > 100)
    
    } ON ROWS
    
    FROM [Nfl2]