Forum Discussion
RanHo
Helper V
2 years agoHow to get/display latest/recent comments per user
Good day!
I need help on this problem, I need to get or show the latest/most recent comments of user in table, here is my sample data/table:
as you can see I have employee and comments table and they are connected, and each user/employee has multiple comment with different date and others has same date but diff time.
Here the result I need :
any idea or help is appreciated!
Thanks in advance!
~Ran
you can create columns
comments date = maxx(RELATEDTABLE(comments),'comments'[COMMENTS DATE]comments = maxx(FILTER(RELATEDTABLE(comments),'comments'[COMMENTS DATE]='employee'[comments date]),comments[COMMENTS])or create measurescommentdate = max('comments'[COMMENTS DATE])cid = maxx(FILTER(comments,comments[COMMENTS DATE]=comments[commentdate]),comments[COMMENTS])pls see the attachmetn below
8 Replies
- ryan_mayu
Super User
could you pls paste the table data here(not the screenshot)?
for Dennis, why the output is not B1? that date is later than B
- RanHo
Helper V
Oh my bad, i will edit just a typo. I'll try to paste it.
- RanHo
Helper V
EMPLOYEE TABLE EMPLOYEE ID EMPLOYEE NAME 90001 Paul 90002 Dennis 90003 Gregory 90004 Nathan 90005 Scott 90006 Julian 90007 Miles 90008 Lara COMMENTS TABLE COMMENT ID EMPLOYEE ID COMMENTS COMMENTS DATE 1001 90001 A 8/1/24 12:31 PM 1002 90002 B 8/1/24 12:00 AM 1003 90004 D 7/6/24 12:00 AM 1004 90002 B1 8/24/24 12:00 AM 1005 90003 C 8/7/24 12:00 AM 1006 90004 D1 7/16/24 12:00 AM 1007 90007 G 9/1/24 9:37 AM 1008 90001 A1 8/13/24 2:23 PM 1009 90005 E 9/2/24 9:33 AM 1010 90005 E1 9/3/24 11:12 AM 1011 90006 F 8/30/24 2:42 PM 1012 90003 C1 8/24/24 6:37 AM 1013 90003 C2 8/28/24 3:41 PM 1014 90007 G1 9/1/24 11:00 AM 1015 90008 H 8/28/24 7:22 AM 1016 90001 A2 8/29/24 8:16 AM 1017 90001 A3 8/29/24 4:00 PM 1018 90008 H1 9/1/24 10:19 AM 1019 90006 F1 8/31/24 3:25 PM 1020 90004 D2 8/17/24 7:25 AM - ryan_mayu
Super User
you can create columns
comments date = maxx(RELATEDTABLE(comments),'comments'[COMMENTS DATE]comments = maxx(FILTER(RELATEDTABLE(comments),'comments'[COMMENTS DATE]='employee'[comments date]),comments[COMMENTS])or create measurescommentdate = max('comments'[COMMENTS DATE])cid = maxx(FILTER(comments,comments[COMMENTS DATE]=comments[commentdate]),comments[COMMENTS])pls see the attachmetn below
- Ashish_Mathur
Super User
Hi,
I would solve this with Power Query. Would you be OK with that?