title: Custom criteria for subgrid view for Dynamics CRM
body: <p>everyone! 
  I have an issue with creating custom criteria for sub-grid view for Dynamics CRM.</p>
  
  <p>I have 3 Entities, let's call them "Companies", "Customers", and "Surveys".</p>
  
  <p>This is the hierarchy:
  <a href="https://i.stack.imgur.com/cvMLD.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/cvMLD.jpg" alt="enter image description here"></a></p>
  
  <p>"Surveys" Entity has field "Score" that contain decimal score of Survey Responses.</p>
  
  <p>On "Customer" entity I print a chart with avg score of customer Surveys:
  <a href="https://i.stack.imgur.com/k3K6g.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/k3K6g.png" alt="enter image description here"></a></p>
  
  <p>test_C_1 is a Company name</p>
  
  <p>test_B_1 is a Customers name</p>
  
  <p>test_A_1 is a Survey name</p>
  
  <p>But I need the same table + avr chart on the Company entity.
  I successfully join the table, but I can`t filter the table for the current (selected) Company. I get the all results and the chart give me the wrong AVR score.
  My wish is to get all "customers with all Surveys" that are related to the current Company.
  <a href="https://i.stack.imgur.com/fKWQT.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/fKWQT.png" alt="enter image description here"></a>
  What is the best method to clear the table from redundant information?</p>
  
  <p>P.S. I need this for Dynamics Versions 7.0 and for the latest version 8.2.</p>
  
  <p>Thank You very much!</p>