Forum Discussion
Hoping
Helper III
3 years agoMax of date columns
I have 5 date columns in a table. I would like to create a new column that shows the max of these 5 date columns. Some of the rows could have null values for any or all of these dates. I want...
edhans
Community Champion
3 years agoList.Max has no issues with nulls. My "Custom" column is finding the Max date from the 4 date columns, some with null.
If you don't have nulls, where null is shown, those are empty, or "", you can filter that out with List.Select first. This does that:
List.Max(
List.Select(
Record.ToList(
Record.SelectFields(_, {"Date1", "Date2", "Date3", "Date4"})
),
each _ <> ""
)
)