title: Tableau Relative Percents
body: <p>How can I calculate percents by row that depend on the total of another single row? For instance, in the table below, all percents are based on the grand total of the first category, "Rectangles."</p>
  
  <pre><code>    Category      Distinct   Percent  
   --------------- ---------- --------- 
    Rectangles           100   100%     
    Squares               90   90%      
    Squares (4x4)         70   70%      
    Squares (8x8)         10   10%    
  </code></pre>
  
  <p>In the example above, 'category' and 'distinct' would be given, and I would want 'percent' to be a calculated field by taking <code>distinct/distinct_Rectangles</code>.</p>