cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
oliver8m
Frequent Visitor

DAX - Group by last comment date of person

Hello, I'm struggling with something probably very simple...

I have the following table:

 

Sans titre1.png

 

I want to keep the latest comment for each person like shown below. 2 comments at the same date for the same person cannot happen with my data.

 

Sans titre2.png

 

Any help?

1 ACCEPTED SOLUTION

Accepted Solutions
BKirsch12 Resolver II
Resolver II

Re: DAX - Group by last comment date of person

This requires a little work to get the appropriate comment on the last date.

 

I did this in power query in excel for ease of use, but it works the same in Power BI.

 

 

First you need to create a comment date key. (Key query in the workbook)

This will allow us to do an inner join to get the appropriate comment.

 

Then you create a seperate query to do the group by. Group by person and add the max date. Then you add the two to make a key and join the two tables. 

 

All of the logic is in the file below:

 

 

https://drive.google.com/file/d/1dVtK64rrc9HzzK9WNFLE-LR5UCHBrnh5/view?usp=sharing

 

 

 

 

 

View solution in original post

1 REPLY 1
BKirsch12 Resolver II
Resolver II

Re: DAX - Group by last comment date of person

This requires a little work to get the appropriate comment on the last date.

 

I did this in power query in excel for ease of use, but it works the same in Power BI.

 

 

First you need to create a comment date key. (Key query in the workbook)

This will allow us to do an inner join to get the appropriate comment.

 

Then you create a seperate query to do the group by. Group by person and add the max date. Then you add the two to make a key and join the two tables. 

 

All of the logic is in the file below:

 

 

https://drive.google.com/file/d/1dVtK64rrc9HzzK9WNFLE-LR5UCHBrnh5/view?usp=sharing

 

 

 

 

 

View solution in original post

Helpful resources

Announcements
New Ranks Launched March 24th!

New Ranks Launched March 24th!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power BI Community!

‘Better Together’ Contest Finalists Announced!

‘Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

Arun 'Triple A' Event Video, Q&A, and Slides

Arun 'Triple A' Event Video, Q&A, and Slides

Missed the Arun 'Triple A' event or want to revisit it? We've got you covered! Check out the video, Q&A, and slides now.

Join THE global Microsoft Power Platform event series.

Join THE global Power Platform event series.

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities.

Community Summit North America

Community Summit North America

Innovate, Collaborate, Grow. The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors