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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
wmarques
New Member

Power Query M - Filtering to Max Date per Group

Very much a novice here so apologies if this query seems a bit basic.

I have a table where one of the columns holds nested tables:

Financial YearAll Rows
2021/22Table
2022/23Table
2023/24Table

 

The nested tables hold a large number of columns and rows which will be manipulated after they're expanded but before that, I need to filter each table to contain only the records that match the latest [Source.DateCreated]. This date would be different for each [Financial Year].

 

Example of Nested Table contents:

Source.DateCreatedForecast Sales Team
1/3/2021564Research
3/3/2021657Research
3/3/2021200Research
3/3/2021354Manufacturing
2/3/2021784Manufacturing

 

My desired result for the above example:

Source.DateCreatedForecast SalesTeam
3/3/2021657Research
3/3/2021200Research
3/3/2021354Manufacturing

 

I know that I can filter by the latest date for a table but I'm clueless on how to do this for a nested table.

Does anyone know how I would go about doing this?

1 ACCEPTED SOLUTION
Anonymous
Not applicable

you should use the add.column function using some criteria like:

 

Table.SelectRows([#"All Rows"], let latest = List.Max([#"All Rows"][Source.DateCreated]) in each [Source.DateCreated] = latest)

 

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

use this scheme if your dataset is not huge

Anonymous
Not applicable

you should use the add.column function using some criteria like:

 

Table.SelectRows([#"All Rows"], let latest = List.Max([#"All Rows"][Source.DateCreated]) in each [Source.DateCreated] = latest)

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.