Forum Discussion
ERing
Post Partisan
3 years agoNeed Help - New column with earliest date for each ID
I need to a way to create the Assigned Date column in Power Query. The goal of the coulmn is to assign the earlist Sale Date for each record with the same Territory_ID. One caveat is that the Assigne...
Vijay_A_Verma
Most Valuable Professional
3 years agoInsert this step as next step where #"Changed Type" should be replaced with your previous step in both the places
= Table.AddColumn(#"Changed Type", "Custom", (x)=> if x[Territory_ID]=null then x[Sale Date] else List.Min(Table.SelectRows(#"Changed Type"[[Territory_ID],[Sale Date]], each ([Territory_ID] = x[Territory_ID]))[Sale Date]))- ERing3 years ago
Post Partisan
Thank you for this. Would it be possible to introdude Status as a criteria so that
if Status = New than Assigned Date = Sales Date
If Status = Existing than Assigned Date = EARLIEST Sale Date for records with same Territory_ID?