title: How to get Current Year and Previous Year values as Columns
body: <p>Can any body please tell me about below case.</p>
  
  <p>I have fact table which has datekey, I have bridge table which has <code>Datekey</code> and <code>PYdatekey</code>( PYDatekey represents last year value).</p>
  
  <p>When I want current year value, I am joining with <code>FactTable.DateKey = BridgeTable.DateKey</code>, for Last year values <code>FactTable.DateKey=BridgeTable.PYDateKey</code>.</p>
  
  <p>I am writing two separate queries doing union all to get these values as rows.</p>
  
  <p>But now I need to get these values as columns. Please suggest how to achieve this.</p>