How do I count the number of rows with same variable?

Hey @helpplease , Try this code

(From row  In dt.AsEnumerable
Group By num = row(0) Into Group
Select dt1.Rows.Add({num,Group.count})).CopyToDataTable

XAML: -
Main.xaml (10.8 KB)

If you do according your data then,

(From row  In dt.AsEnumerable
Group By num = row(0) Into Group
Let Clock = Group.Select(Function(row) row(1)).First()
Select dt1.Rows.Add({num,Clock,Group.count})).CopyToDataTable

@helpplease

Once check the data table variable it is empty

Either dt1 is not been initialized to any value, so before you can use build datatable and set its output as dt1 or use assign and put left as dt1 and right as DT.Clone

If dt1 has been initialized and your using the xaml i have sent, then DT may not be initialized