zach
zach

Reputation: 1241

Create a Measure or Calculated Column to Find Max Date in a Column of Dates

I have a column which is a list of variable amounts of dates. I would like to create a measure or a calculated column that will do the following:

Loop over all the individual dates to find the Latest Date.

Below is a table of what I would expect MaxDate to return.

enter image description here

I currently am splitting Dates in the Query Editor and finding the MAXX of the columns, but that is only a temporary solution as the number of Dates can grow quite large.

Upvotes: 1

Views: 607

Answers (1)

Alexis Olson
Alexis Olson

Reputation: 40244

You can do this in the query editor with a custom column. Use Text.Split to turn your Dates column into a list, List.Transform the list of text dates to date type, and then take the List.Max.

The formula for the custom column:

List.Max(List.Transform(Text.Split([Dates], ","), each Date.FromText(_)))

Upvotes: 4

Related Questions