Group By in Power Query Date Column Grab first date in list - DAT Script Dataverse

Here's the code for the entire grouping that put all the Students grouped by House Hold ID. However I needed the first date that the first student entered the school district.

 

Here's the Entire DAT:

Table.Group(#"Removed columns", {"its_name"}, {{"StudentsInHHID", each List.Count(List.Distinct([its_studentid])), Int64.Type}, {"StudentNames", each Text.Combine([its_lastfirst]," - "), type nullable text}, {"StudentIDs", each Text.Combine([its_studentid]," - "), type nullable text}, {"MailingAddress", each Text.Combine([its_mailing_street]," - "), type nullable text}, {"HomeLess", each Text.Combine([its_u_truancyhomeless]," - "), type nullable text},{"DistrictEntryDate", each List.First([its_districtentrydate]), type nullable date}})

 

The DAT responsible for the first date

{"DistrictEntryDate", each List.First([its_districtentrydate]), type nullable date}

What it looks like

 

Blog Type: