Max Date from Power query list

trev1234

New Member
Joined
Mar 13, 2021
Messages
13
Office Version
  1. 365
Platform
  1. Windows
I am looking to find out how to add an extra column in my power query to let me know the max date of each site, so in all the rows with one they would say 10/11/22 and rows with 2 would say 05/11/22. I hope that makes sense and someone can help
thanks

SiteDate
109/11/2022
110/11/2022
109/11/2022
229/10/2022
205/11/2022
222/10/2022
215/10/2022
205/11/2022
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
There might be a more efficient way coding in M directly, but I would duplicate the query and then GroupBy Site and then use the maximum operation. You will then have a table of a single site and the latest date. You could then merge the query with your original data using the Site as the identifier.
 
Upvote 0
Solution
You can use something like:

Power Query:
Table.AddColumn(#"Changed Type", "Custom", each List.Max(Table.SelectRows(Source, (row)=> [Site] = row[Site])[Date]))

where Source is the previous step name.
 
Upvote 0

Forum statistics

Threads
1,223,268
Messages
6,171,100
Members
452,379
Latest member
IainTru

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top