title: Power BI Measure to calculate percentage which changes with filters
body: <p>I want to create a visualisation from a dataset which shows percentages that change accordingly when filters are used.</p>
  
  <p>I have a dataset like the below but with over 1 million rows of data covering 18 months. All the fields are text except Month which is a date and SUMofAPPTS which is numerical.</p>
  
  <pre><code>SUPP    GEOG1   MODE    STATUS  TYPE    TIME    Month   Day    SUMofAPPTS
  AA  00D Face    Att     1       1       Day     2018-06 Sun    12
  AA  00D Face    Att     1       1       Day     2018-06 Mon    119
  AA  00D Face    Att     1       4       Unk     2018-06 Tues   98
  BB  00D Tel     DNA     2       1       Day     2018-06 Weds   98
  BB  00D Online  DNA     3       1       Day     2018-06 Thurs  126
  CC  00D Face    DNA     1       2       Day     2018-07 Sun    8
  </code></pre>
  
  <p>I would like a measure which calculates the percentage of <code>SUMofAPPTS</code> by <code>Day</code> and <code>MODE</code> (and the same but for <code>STATUS</code>, <code>TYPE</code> and <code>TIME</code>) which changes when filters are placed on the other fields.</p>
  
  <p>So I think I need to make this simple calculation (which would work in a column if I just wanted to know the percentage per row of the whole dataset) more dynamic so that it works when I filter the data:</p>
  
  <pre><code>PERCENT = 'dataset'[SUMofAPPTS]/SUM('dataset'[SUMofAPPTS])
  </code></pre>
  
  <p>The end result will be a stacked bar chart with the following attributes:</p>
  
  <ul>
  <li>Day as the Axis</li>
  <li>PERCENT as the Value</li>
  <li>MODE, STATUS, TYPE or TIME as the Legend</li>
  <li>Ability to filter by one, many or all of the fields except Day and SUMofAPPTS</li>
  </ul>