title: DAX suggestions to generate specific weighted average measure in PowerBI?
body: <p>I'm trying to formulate weighted average measures in PowerBi for survey data. I've currently got the following two tables (simplified):</p>
  
  <p><strong>Survey Data</strong></p>
  
  <pre><code>ID           How would you score the service?      Do you agree with X?
  ---------------------------------------------------------------------------
  23           Fair                                  Agree
  24           Poor                                  Strongly disagree
  25           Fair                                  Agree
  26           Very poor                             *blank*
  27           Very good                             Strongly agree
  </code></pre>
  
  <p><strong>Weights</strong></p>
  
  <pre><code>Weight         Score         Likert
  -------------------------------------------------
   1             Very poor     Strongly disagree
   2             Poor          Disagree
   3             Fair          Neither agree nor disagree
   4             Good          Agree
   5             Very good     Strongly Agree
  </code></pre>
  
  <p>There's currently a relationship between <code>'surveydata'[How would you score the service?]</code> and <code>'weights'[weight]</code>.</p>
  
  <p>The weighted average formula I'm trying to calculate is the following:</p>
  
  <pre><code>                (x1 * w1) + (x2 * w2) + ... (xn * wn)
  Weighted Ave = ___________________________________________
                            x1 + x2 + ... xn
  </code></pre>
  
  <p>Where:</p>
  
  <pre><code>w = weight of answer choice
  x = response count for answer choice
  </code></pre>
  
  <p>For the example above, I would need two measures - a weighted average for <code>'surveydata'[How would you score the service?]</code> and one for <code>'surveydata'[Do you agree with X?]</code>. </p>
  
  <p>For the example above, the weighted average measure for <code>'surveydata'[How would you score the service?]</code> should be 2.8.</p>
  
  <p>Note that one of the complications is the fact that there are <em>*blank*</em> cells. </p>
  
  <p>Can anyone suggest a way of doing this in PowerBI with calculated measures (or otherwise)?</p>