title: Power BI: Percent Overlap Between Groups
body: <p>I have a dataset in which I have two columns: Class &amp; Student. I am trying to find the percent overlap between classes (e.g. what percent of students in Class A are also enrolled in Class B)?</p>
  <p>I'd assume that this should be done in PowerQuery by expanding the table over itself to compare each class and then maybe a groupby to show the percent overlap? Any ideas?</p>
  <p>Here's some sample data and expected output:</p>
  <p><a href="https://i.stack.imgur.com/n0Jl2.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/n0Jl2.png" alt="enter image description here" /></a></p>
  <p>Desired output (random generated percentages):</p>
  <p><a href="https://i.stack.imgur.com/hL0Ag.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/hL0Ag.png" alt="enter image description here" /></a></p>