Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
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. | Name | Job Des | Status | Start Date | Count (Result) |
| 9287 | John | A | Hire | 27 Sep 2022 | 1 |
| 9287 | John | B | Rehire | 20 Nov 2022 | 0 |
| 9277 | Alice | X | Hire | 27 Nov 2022 | 1 |
| 9277 | Alice | Y | Rehire | 20 Apr 2023 | 1 |
| 9652 | Mary | X | Hire | 27 Nov 2022 | 1 |
| 9652 | Mary | Y | Rehire | 2 Feb 2023 | 0 |
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})
Hi 4th row is in next FY. So I need to count as 1. I will try the quote. Thank you again!
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!