title: MDX filter level member
body: <p>My question is how to filter valid field by another field in MDX.</p>
  
  <p>I have one table: samples;
  if I use sql to solve problem , just like this:</p>
  
  <pre><code>select patient_id from samples where calc_test_type_id = 1;
  </code></pre>
  
  <p>I created dimension for this: Patient Characteristic 
           Hierarchy: id 
           level : id (patient id in samples table) , including property, named 'testA', 'testA' linked to calc_test_type_id.</p>
  
  <p>So I tried MDX like this : </p>
  
  <pre><code>SELECT
  {[Measures].[num_samples]} ON COLUMNS,
  
  {
    filter
         (
         distinct([Patient characteristic.id].[id].members),
         [Patient characteristic.id].CurrentMember.Properties("calc_type") = 1
         )
  } ON ROWS
  FROM [EIDCube]
  </code></pre>
  
  <p><code>[Measures].[num_samples]</code> is to calculate how many rows for <code>calc_test_type_id = 1</code>.</p>
  
  <p>But I found some data lost. So how to find all suitable patient id ?</p>