We need to groupby data from source to destination using a group_by() function and then summarize it find number of records in each grouped by set. That will provide us the desired result. Please refer below.