title: Report Builder: How do MDX filter expressions work in Query Designer?
body: <p>I'm trying to write some reports against a TFS cube. I'd like to utilize query builder since I'm fairly new to MDX and I'd prefer not to write the entire query; however, it doesn't seem very easy to inject MDX into the query designer's dimension filter expressions. Is there a special syntax to enter them in?</p>
  
  <p>For instance, say I want to show the top 10 heaviest code churn dates in a certain date range. In the query designer:</p>
  
  <ul>
  <li>I drop in a Date dimension and mark it as a parameter.</li>
  <li>I drop in the Version Control Changeset, set hierarchy to Changeset Id, operator to MDX.</li>
  <li>I then use the filter expression builder to construct <code>TOPCOUNT([Version Control Changeset].[Changeset ID], 10, [Measures].[Total Churn])</code></li>
  <li>Back in the query designer, I set Date, Changeset ID, and Total Churn to be my columns.</li>
  </ul>
  
  <p>The generated query is as follows:</p>
  
  <p><code>SELECT NON EMPTY { [Measures].[Total Churn] } ON COLUMNS, NON EMPTY { ([Date].[Date].[Date].ALLMEMBERS * [Version Control Changeset].[Changeset ID].[Changeset ID].ALLMEMBERS ) } DIMENSION PROPERTIES MEMBER_CAPTION, MEMBER_UNIQUE_NAME ON ROWS FROM ( SELECT ( TOPCOUNT([Version Control Changeset].[Changeset ID], 10, [Measures].[Total Churn]) ) ON COLUMNS FROM ( SELECT ( STRTOSET(@DateYearMonthDateHierarchy, CONSTRAINED) ) ON COLUMNS FROM [Code Churn])) WHERE ( IIF( STRTOSET(@DateYearMonthDateHierarchy, CONSTRAINED).Count = 1, STRTOSET(@DateYearMonthDateHierarchy, CONSTRAINED), [Date].[Year - Month - Date Hierarchy].currentmember ) ) CELL PROPERTIES VALUE, BACK_COLOR, FORE_COLOR, FORMATTED_VALUE, FORMAT_STRING, FONT_NAME, FONT_SIZE, FONT_FLAGS</code></p>
  
  <p>However, both in the query designer's preview area and when I run the report, it's as if the TOPCOUNT isn't being applied and instead of seeing the top 10, I see all of them. The expression parses correctly; it just doesn't seem to do anything. Is there an easy gotcha that I've missed?</p>
  
  <p>Thanks!</p>