title: Passing Parameters using a Calculated member - MDX
body: <p>I am trying to build a query with parameters using a calculated member. </p>
  
  <p>I have created calculated members for judicial counts which are "hard coded" and the parameter I created does not effect the totals of each group.</p>
  
  <p>However, I need to have each of the total counts listed with a working parameter. If there is no value for the selected judicial type a zero count should be displayed. </p>
  
  <p>Im sure there is an easy way, but im fairly new to MDX/SSRS. Any help is greatly appreciated!</p>
  
  <p>Here is the query:</p>
  
  <pre><code>WITH 
  
  Member  [Measures].[Jud] as
          (
          [Dim Foreclosure Loan].[Judicial Flag].[1],
          [Dim Foreclosure Loan].[FCL Stage].&amp;[Sale Held],
          [Measures].[Loan Count]
          )
  Member  [Measures].[Non-Jud] as
          (
          [Dim Foreclosure Loan].[Judicial Flag].[0],
          [Dim Foreclosure Loan].[FCL Stage].&amp;[Sale Held],
          [Measures].[Loan Count]
          )
  Member  [Measures].[Total] as
          (
          [Dim Foreclosure Loan].[Judicial Flag],
          [Dim Foreclosure Loan].[FCL Stage].&amp;[Sale Held],
          [Measures].[Loan Count]
          )
  --------------------------------    Query Begins    --------------------------------
  SELECT NON EMPTY
          {
          ([Dim Date].[Calendar].[Day].Members)
          } ON ROWS,
          NON EMPTY 
          ({
          ([Measures].[Jud]),
          ([Measures].[Non-Jud]),
          ([Measures].[Total])
          }) ON COLUMNS
          FROM ( SELECT ( STRTOSET(@DimForeclosureLoanJudicialFlag, CONSTRAINED) ) ON COLUMNS
          FROM [Foreclosure])
          WHERE 
          (IIF( STRTOSET(@DimForeclosureLoanJudicialFlag, CONSTRAINED).Count = 1,
          STRTOSET(@DimForeclosureLoanJudicialFlag, CONSTRAINED),
          [Dim Foreclosure Loan].[Judicial Flag].currentmember)
          )CELL PROPERTIES VALUE
  </code></pre>
  
  <p><strong>Update</strong>: Need help with the iif statment provided; see comments below.</p>