Forum

Keep rows but remov...
 
Notifications
Clear all

Keep rows but remove duplicates in a column

9 Posts
4 Users
0 Reactions
78 Views
(@hutchdjr)
Posts: 17
Eminent Member
Topic starter
 

Good Day

Please can you assist, I have daily data for each staff name and I would like to summarize the data by department and number of staff for each department. I was thinking of duplicating the staff name column and removing the duplicates but keeping the rows and summarizing the data in pivot tables. Not sure if this can be done.

Thanks for your help

 
Posted : 25/06/2022 3:15 am
(@adam-bender)
Posts: 5
Active Member
 

Hi David.  Can you post some sample data?  That would be helpful to better understand what you're looking at.

I'm thinking that what you're looking for is the "Group By" function.  You could use the Count function within Group By to count the number of staff, and then probably sum or average the measures you're trying to summarize.

 
Posted : 25/06/2022 2:56 pm
(@hutchdjr)
Posts: 17
Eminent Member
Topic starter
 

Good Day

Sorry for not getting back sooner.

Attached is the sample data requested.

Thanks again for all your help.

 
Posted : 29/06/2022 11:12 am
(@mynda)
Posts: 4761
Member Admin
 

Hi David,

It's not clear if you want a staff count by day, or whether the day data is irrelevant. If the date is irrelevant, then like Adam suggested, you can use the Group By function in Power Query to get the count after removing duplicate names. See attached.

If you were after something else, then please provide a mock-up of your desired result based on your sample file.

Mynda

 
Posted : 29/06/2022 8:11 pm
(@hutchdjr)
Posts: 17
Eminent Member
Topic starter
 

Hi Mynda

Thanks for your reply.

I am trying to count the number of staff by department who are either late or absent in one report on a daily and monthly basis. In another report, by name, department for either late or absent and lost late time also daily and monthly. I would like to keep the date which can be month and year because I need to track monthly to monitor performance. See attached mock-up reports.

I hope this makes sense.

Dave

 
Posted : 30/06/2022 9:55 am
Riny van Eekelen
(@riny)
Posts: 1195
Member Moderator
 

Hi David, the attached file contains the PT's you want.

Needed to transfer the dates to real dates using Text-to-columns and grouped the dates in the PT by month.

 

Riny

 
Posted : 30/06/2022 10:13 am
(@hutchdjr)
Posts: 17
Eminent Member
Topic starter
 

Hi Mynda

Please disregard my attachment as I forgot to add one report.

What I have attached is what is reported on a daily and monthly basis.

Dave

 
Posted : 30/06/2022 11:10 am
(@hutchdjr)
Posts: 17
Eminent Member
Topic starter
 

Hi Riny

Thanks I was not thinking I had not converted the dates from text to proper dates and I have grouped the dates. I was not thinking.

Thanks for the support.

Dave

 
Posted : 30/06/2022 11:33 am
(@mynda)
Posts: 4761
Member Admin
 

Hi David,

It looks like Riny has answered your question. Please advise if not as I've lost track!

Mynda

 
Posted : 30/06/2022 7:02 pm
Share: