Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
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!