Forum Discussion
Filter on last row for each article
- 1 year ago
Hi joshua1990 Could you try this please
Remove Unnecessary Columns:
- Select master data columns and use Remove Other Columns.
Sort by Article and Year-Week:
- Sort Article (ascending) and Year-Week (descending).
Group by Article:
- Go to Home → Group By:
- Group by Article and choose All Rows.
- Go to Home → Group By:
Keep the Latest Row:
- Add a custom column with:Table.FirstN([All Data], 1)
- Expand the table to show required fields.
- Add a custom column with:
Add "Last Entry" Column:
- Create a column for Year-Week and rename it Last Entry.
If this post helped please do give a kudos and accept this as a solution
Thanks In Advance
- Create a column for Year-Week and rename it Last Entry.
- 1 year ago
From
Using
let Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content], #"Changed Type" = Table.TransformColumnTypes(Source,{{"Year-Week", type date}, {"Article", type text}, {"Team", type text}, {"Country", type text}, {"Department", type text}, {"Group", type text}}), #"Grouped Rows" = Table.Group(#"Changed Type", {"Article"}, {{"Rows", each Table.Last(_)}}), #"Expanded Rows" = Table.ExpandRecordColumn(#"Grouped Rows", "Rows", {"Year-Week", "Team", "Country", "Department", "Group"}, {"Year-Week", "Team", "Country", "Department", "Group"}) in #"Expanded Rows"To
Did I answer your question? Then please (also) mark my post as a solution and make it easier to find for others having a similar problem.
Remember: You can mark multiple answers as a solution...
If I helped you, please click on the Thumbs Up to give Kudos.Kees Stolker
A big fan of Power Query and Excel
- 1 year ago
Hi joshua1990 , here's a solution you could look at. In case of any clarifications or if I haven't got your query correctly, don't hesitate to correct me or ping back. I'll attach the image of the code below. Thanks!
Hi joshua1990,
Thank you for reaching out in Microsoft Community Forum.
Thank you Akash_Varuna , SundarRaj , PwerQueryKees for the helpful response.
As recommended by AKash_Varuna, SundarRaj, PwerQueryKees., we trust that the provided solution is accurate and has resolved your issue.
Please continue using Microsoft community forum.
If you found this post helpful, please consider marking it as "Accept as Solution" and select "Yes" and give it a 'Kudos'. if it was helpful. help other members find it more easily.
Regards,
Pavan.