title: Creating an MDX measure in Excel to count members of one dimension based on another dimension
body: <p>I am trying to create an MDX measure in Excel (in OLAP Tools) that will count how many members there are for every other item in another dimension. As I don't know the exact syntax and notation for MDX and OLAP cubes I will try to simply explain what I want to do: </p>
  
  <p>I have a pivot table based on an OLAP Cube. I have a Machine Number field stored in one dimension, that is the "parent" and for every machine number there is a number of articles that were produced (in certain period of time). Those articles are represented by Order Numbers. Those numbers are stored in another dimension. I would like the measure to count how many order numbers there are for every machine number. </p>
  
  <p>So the table looks like this: </p>
  
  <pre><code>+------------------+----------------+
  | [Machine Number] | [Order Number] |
  +------------------+----------------+
  | Machine001       |                |
  |                  |      111111111 |
  |                  |      222222222 |
  |                  |      333333333 |
  | Machine002       |                |
  |                  |      444444444 |
  |                  |      555555555 |
  |                  |      666666666 |
  |                  |      777777777 |
  +------------------+----------------+
  </code></pre>
  
  <p>and I would like the result to be:</p>
  
  <pre><code>+------------------+----------------+------------+
  | [Machine Number] | [Order Number] | [Measure1] |
  +------------------+----------------+------------+
  | Machine001       |                |          3 |
  |                  |      111111111 |            |
  |                  |      222222222 |            |
  |                  |      333333333 |            |
  | Machine002       |                |          4 |
  |                  |      444444444 |            |
  |                  |      555555555 |            |
  |                  |      666666666 |            |
  |                  |      777777777 |            |
  +------------------+----------------+------------+
  </code></pre>
  
  <p>I've tried using the COUNT function with EXISTING as well, but it wouldn't work (always showing 1, or the same wrong number for every machine). I believe that I have to somehow connect those two dimensions together so the Order Number is dependent to Machine Number, but lacking the knowledge about MDX and OLAP Cubes I don't even know how to ask Google how to do that.
  Thanks in advance for any tips and solutions.</p>