title: Power Query - Counting non blanks in column in Group function
body: <p>I'm not a pro in writing code from scratch in Power Query, rather clicking it and tweaking only to my needs and I got stuck when using Group function. There is only option of counting rows and I would like to count non blank cells in specific column.</p>
  
  <p>Code looks like this:</p>
  
  <pre><code>= Table.Group(#"Replaced Value", 
       {"Company Name", "Policy Number", "Division", "Date"}, 
           {{"Count", each Table.RowCount(_), type number}, 
           {"Sum", each List.Sum([Claim Amount]), type number
           }
       })
  </code></pre>
  
  <p>it has to group data by four fields (Company Name, Policy Number, Division, Date) and return number of claims and sum of claims.</p>
  
  <p>I tried changing it to use Counta function: <a href="https://msdn.microsoft.com/en-us/query-bi/dax/counta-function-dax" rel="nofollow noreferrer">https://msdn.microsoft.com/en-us/query-bi/dax/counta-function-dax</a> example below:</p>
  
  <pre><code>= Table.Group(#"Replaced Value", 
       {"Company Name", "Policy Number", "Division", "Date"}, 
           {{"Count", each List.Counta([Claim Amount]), type number}, 
           {"Sum", each List.Sum([Claim Amount]), type number
           }
       })    
  </code></pre>
  
  <p>and many other variations of above but without any luck. Can you help me and tell what I'm doing wrong here.</p>
  
  <p>EDIT: I already considered removing nulls before grouping but I actually need information that in certain group there were 0 claims in particular month.</p>
  
  <p>Thanks in advance for your help</p>