Forum Discussion
Replace Value Based on latest date
- 5 years ago
=Table.Combine(Table.Group(Source,"Name",{"n",each let NewLocation=Table.First(Table.Sort(_,{"Date",1}))[Location] in Table.ReplaceValue(_,null,NewLocation,(x,y,z)=>z,{"Location"})})[n])
- eyespike15 years agoFrequent Visitor
Daniel,
Thanks for your reply. You code worked, unfortunately I didn't clearly state that I would have multiple "Names".
Is it possible for you to modify so we are getting the most recent location by date for each name?
Somebody's locations would be Location2
Somebody2's locations would be Location6
Somebody3's locations would be Location13
Thank you!
- wdx223_Daniel5 years ago
Community Champion
=Table.Combine(Table.Group(Source,"Name",{"n",each let NewLocation=Table.First(Table.Sort(_,{"Date",1}))[Location] in Table.ReplaceValue(_,null,NewLocation,(x,y,z)=>z,{"Location"})})[n])
- eyespike15 years agoFrequent Visitor
That worked! Thank you so much!