Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more
Hi all
In the power query I have 2 columns
Date and Id.
Sample dataset is below:
Date. Id
01/01/2025. 101
01/09/2025. 101
Solved! Go to Solution.
Hi, If you have 2 columns only and then better to group by ID column and take the Max of the date.
Below is the dataset I took:
then done a Group By
Final output
Hope this helps to resolve your problem. If it does, then please mark it as solution.
Thanks - Samrat
The safest way to do that is to use the grouping feature
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjQwUNJRMtU31jcyMDJVitUBCRkChQwM9YEISRCkzkTf2ACbQkuoYCwA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [ID = _t, Date = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Date", type date}, {"ID", Int64.Type}}),
#"Grouped Rows" = Table.Group(#"Changed Type", {"ID"}, {{"Date", each List.Max([Date]), type nullable date}})
in
#"Grouped Rows"
How to use this code: Create a new Blank Query. Click on "Advanced Editor". Replace the code in the window with the code provided here. Click "Done". Once you examined the code, replace the entire Source step with your own source.
Hi @lbendlin , @samratpbi thanks for pitching in . I created a new column that using list.max that gives max of the date else the older date will be blank
The safest way to do that is to use the grouping feature
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjQwUNJRMtU31jcyMDJVitUBCRkChQwM9YEISRCkzkTf2ACbQkuoYCwA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [ID = _t, Date = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Date", type date}, {"ID", Int64.Type}}),
#"Grouped Rows" = Table.Group(#"Changed Type", {"ID"}, {{"Date", each List.Max([Date]), type nullable date}})
in
#"Grouped Rows"
How to use this code: Create a new Blank Query. Click on "Advanced Editor". Replace the code in the window with the code provided here. Click "Done". Once you examined the code, replace the entire Source step with your own source.
Hi, If you have 2 columns only and then better to group by ID column and take the Max of the date.
Below is the dataset I took:
then done a Group By
Final output
Hope this helps to resolve your problem. If it does, then please mark it as solution.
Thanks - Samrat
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.