Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
Hello,
I have been stuck on this for sevearl days and am now reaching out for help. I have a table with the structure as below:
The result I'm looking for is:
When I try group by, I am still getting duplicates instead of the row with the earliest "DateSubmitted". I need to see all the columns, with the earliest "DateSubmitted" for each recordID. I have tried "Basic" group by using RecordID, operation MIN, column DateSubmitted. That didn't work. I also tried Advanced group by, adding all columns except DateSubmitted to the grouping level - and then again, MIN of DateSubmitted. In each case, I'm getting duplicates.
Any help would be greatly appreciated as I've been stuck on this for days despite many attempts at different solutions!
Solved! Go to Solution.
Hi @goatmonslc,
Try something like this:
let
Source = YourTable,
GroupRows = Table.Group(Source, {"RecordID"}, {{"t", each Table.Min(_, "DateSubmitted"), type [RecordID=nullable text, Project=nullable text, Description=nullable text, ReportType=nullable text, DateSubmitted=nullable date]}}),
ExpandRec = Table.ExpandRecordColumn(GroupRows, "t", {"Project", "Description", "ReportType", "DateSubmitted"}, {"Project", "Description", "ReportType", "DateSubmitted"})
in
ExpandRec
I hope this is helpful
To resolve this issue, you can sort the table by the "Date Submitted" column in ascending order. Then, select both the "RecordID" and "Project" columns, right-click on one of them, and choose "Remove Duplicates."
However, be cautious—if you perform these steps separately, the sorting step will be ignored. To avoid this, you should either combine the steps as shown below or use the Table.Buffer function after sorting, before applying Table.RemoveDuplicates.
= Table.Distinct(Table.Sort(Source,{{"DateSubmitted", Order.Ascending}}), {"RecordID", "Project"})
If this answer helped resolve your issue, please consider marking it as the accepted answer. And if you found my response helpful, I'd appreciate it if you could give me kudos.
Thank you!
Hi @goatmonslc ,
Thanks for m_dekorte's reply!
And @goatmonslc , I have tested m_dekorte's reply and it works perfectly!
If m_dekorte's reply can help you to solve your problem, please accept m_dekorte's reply as solution so that more users can find the solution and learn faster, thanks!
Best Regards,
Dino Tao
To resolve this issue, you can sort the table by the "Date Submitted" column in ascending order. Then, select both the "RecordID" and "Project" columns, right-click on one of them, and choose "Remove Duplicates."
However, be cautious—if you perform these steps separately, the sorting step will be ignored. To avoid this, you should either combine the steps as shown below or use the Table.Buffer function after sorting, before applying Table.RemoveDuplicates.
= Table.Distinct(Table.Sort(Source,{{"DateSubmitted", Order.Ascending}}), {"RecordID", "Project"})
If this answer helped resolve your issue, please consider marking it as the accepted answer. And if you found my response helpful, I'd appreciate it if you could give me kudos.
Thank you!
Thanks this worked like a charm!
Hi @goatmonslc,
Try something like this:
let
Source = YourTable,
GroupRows = Table.Group(Source, {"RecordID"}, {{"t", each Table.Min(_, "DateSubmitted"), type [RecordID=nullable text, Project=nullable text, Description=nullable text, ReportType=nullable text, DateSubmitted=nullable date]}}),
ExpandRec = Table.ExpandRecordColumn(GroupRows, "t", {"Project", "Description", "ReportType", "DateSubmitted"}, {"Project", "Description", "ReportType", "DateSubmitted"})
in
ExpandRec
I hope this is helpful
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the September 2025 Power BI update to learn about new features.