Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Power Query in Power BI Desktop - Group by

Hello,

 

   I have imported a table from a SQL Server database. I now want to apply a filter to the max(timestamp field) grouping by user and event. How do I do that in Power Query. I amm attempting to get the latest event from an event list for each event and user.

 

Cheers!

 

Peter

2 Replies

  • richbenmintz's avatar
    richbenmintz
    Icon for Resident Rockstar rankResident Rockstar

    Hi Anonymous,

     

    I think you will want to create a grouped index and then filter where the index = 1, please see the following blog post that shows how to create a grouped index in power query, https://radacad.com/create-row-number-for-each-group-in-power-bi-using-power-query Another alternative would be to edit your source query to rank the data and return the row you are looking for per group.

     

    Hope this Helps,
    Richard
    Did I answer your question? Mark my post as a solution!
    Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!