title: SQL Server calculate percentage of sql pivot value
body: <p>I currently have a SQL Server pivot with values per month and per <code>input sales</code></p>
  
  <p>I want to calculate % of <code>input_sales = 'OK'</code>.</p>
  
  <p>How can I do this?</p>
  
  <pre><code>SIGNED  INPUT_SALES DEALER     D2D  CALLCENTER  INTERNET&lt;/tr&gt;
  2012-01 NOK          158       1231     309       214
  2012-01 OK           417       4634    4047      1491
  2011-12 NOK          301       1637     404       245
  2011-12 OK           615       4195    4334      1985
  </code></pre>
  
  <p>My Code:</p>
  
  <pre><code>SELECT SIGNED_DATE, 
      INPUT_SALES, 
      [DEALER] AS DEALER, 
      [D2D] AS D2D, 
      [CALLCENTER] AS CALLCENTER, 
      [INTERNET] AS INTERNET
  FROM
  (
      SELECT ENTITLEMENT_ID, SALES_CHANNEL, SIGNED_DATE, INPUT_SALES
      FROM #TEMP
  ) T
  PIVOT
  (
      COUNT (ENTITLEMENT_ID)
      FOR SALES_CHANNEL IN
          ([DEALER], [D2D], [CALLCENTER], [INTERNET])
  ) AS PVT
  ORDER BY PVT.SIGNED_DATE DESC
  </code></pre>