Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

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
BKirsch12
Resolver II
Resolver II

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

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

 

 

 

 

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.