title: Looking for a way to calculate aggregates without collapsing rows
body: <p>As the title says, I'd like to find an efficient way to calculate aggregates over groups of rows without collapsing those rows together. For an example I want to create the <code>mean</code> column in the table below.</p>
  <pre><code>|------------|---------|-------------|
  |  category  |  value  | mean(value) |
  |------------|---------|-------------|
  |      A     |    1    |      3      |
  |------------|---------|-------------|
  |      A     |    3    |      3      |
  |------------|---------|-------------|
  |      A     |    5    |      3      |
  |------------|---------|-------------|
  |      B     |    1    |     1.5     |
  |------------|---------|-------------|
  |      B     |    2    |     1.5     |
  |------------|---------|-------------|
  </code></pre>
  <p>So far, the best way I've found to do this is:</p>
  <pre><code>T
  | join kind=leftouter (T | summarize avg() by category) on category
  </code></pre>
  <p>This seems to be causing performance problems. I'm also aware of a way of doing it using <code>partition by</code>, but need to support having more than 64 categories.</p>
  <p>Am I missing a good way of doing this task?</p>