Forum Discussion

dd_au's avatar
dd_au
New Member
2 years ago
Solved

Group By - Filter by latest date within weekending

Hi all,    Pretty new to PowerBi so apologies for the basic question.  I've been using Group By but it's no longer achieving what I need and want to find a better way to group values. I want to ...
  • BA_Pete's avatar
    2 years ago

    Hi dd_au ,

     

    You're correct, using MAX aggregators in the Group By isn't going to help you here - you need to group to a nested table then select the row of data which has the MAX of [date].

     

    Try this:

    1) Group By [week ending] and [item]. For the aggregate column, choose the 'All Rows' operator and call this column 'data'.

    2) Now you have your nested table column, add a new custom column like this:

    Table.Max([data], "date")

    You will now have a nested Record column that contains the full row of data for the max [date] value.

    3) Expand the nested Record column, choosing whichever columns you want to reinstate back to the table.

     

    Pete