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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.