Forum Discussion
neilmc
3 years agoFrequent Visitor
Filter rows by max date keeping ID
Hello I have the data below Ideally I would like to select for each PerID the containing the latest date. I've tried groupby in query editor (groupby perID then select Max date and all rows, how...
- Anonymous3 years ago
Hi neilmc ,
According to your description, here are my steps you can follow as a solution.
(1) My test data is the same as yours.
(2) We can create a table.
Table 2 = var _a=ADDCOLUMNS('Table',"max", CALCULATE(MAX('Table'[StartDate]),FILTER('Table','Table'[PerID]=EARLIER('Table'[PerID])))) var _b= FILTER(_a,[StartDate]=[max]) return SELECTCOLUMNS(_b,"PerID",[PerID],"DBID",[DBID],"StartDate",[StartDate])(3) Then the result is as follows.
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Ahmedx
3 years agoSuper User
can you show the result you expect