title: DAX measure: disctinct count per group
body: <p>Excel - Power Pivot</p>
  
  <p>I am trying to create a measure to calculate a disctinct count (or a sum of a disctinct count) of a column - grouped by a second column.</p>
  
  <p>Based on the column "lot" an the column "sku", I want to calculate the column "count_distinct_sku_by_lot". Column "sqm" is not relevant.</p>
  
  <p>Which DAX code I could use?</p>
  
  <p><a href="https://i.stack.imgur.com/DORCr.png" rel="nofollow noreferrer">(picture of data added)</a></p>
  
  <p>lot     sku sqm count_distinct_sku_by_lot 
  lot1    sku1    1   1
  lot2    sku2    2   2
  lot2    sku2    3   2
  lot2    sku3    4   2
  lot3    sku4    5   3
  lot3    sku4    6   3
  lot3    sku5    7   3
  lot3    sku5    8   3
  lot3    sku6    9   3
  lot4    sku7    11  1</p>