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.
Code looks like this:
= Table.Group(#"Replaced Value",
{"Company Name", "Policy Number", "Division", "Date"},
{{"Count", each Table.RowCount(_), type number},
{"Sum", each List.Sum([Claim Amount]), type number
}
})
it has to group data by four fields (Company Name, Policy Number, Division, Date) and return number of claims and sum of claims.
I tried changing it to use Counta function: https://msdn.microsoft.com/en-us/query-bi/dax/counta-function-dax example below:
= 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
}
})
and many other variations of above but without any luck. Can you help me and tell what I'm doing wrong here.
EDIT: I already considered removing nulls before grouping but I actually need information that in certain group there were 0 claims in particular month.
Thanks in advance for your help