Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
SXW_A_T
New Member

Check Duplicate count in Power Query

Hi, i have a dataset as follows. I wanted to use PowerQuery to check for duplicates and only count the person with the earlier start date within the financial year (1 Apr 2022 to 31 March 2023). How can i make the count to appear as a the result? Thank you in advance!

 

Person No.NameJob DesStatusStart DateCount (Result)
9287JohnAHire27 Sep 20221
9287JohnBRehire20 Nov 20220
9277AliceXHire27 Nov 20221
9277AliceYRehire20 Apr 20231
9652MaryXHire27 Nov 20221
9652MaryYRehire2 Feb 20230
2 REPLIES 2
wdx223_Daniel
Super User
Super User

the 4th row should be 0 because of the date is not in your financial year.

NewStep = Table.FromRecords(List.Accumulate(Table.ToRecords(PreviousStepName),{{},{}},(x,y)=>let a=y[Start Date]>=#date(2022,4,1) and y[Start Date]<#date(2023,4,1) and not List.Contains(x{1},y[Name]) in {x{0}&{y&[Count=Byte.From(a)]},if a then x{1}&{y[Name]} else x{1}}){0})

wdx223_Daniel_0-1678849719862.png

 

Hi 4th row is in next FY. So I need to count as 1. I will try the quote. Thank you again!

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors