Forum Discussion
Anonymous
4 years agoNot applicable
Calculating Min date and Max date from multiple date columns for each row in Power query.
Finding Min(Start) date and Max(End) for below sample data- For each Row. Some of the dates will be blank as well NPI Program P/n count est Mfg Facility Location Launch GW1 GW2 GW3 PD1...
- 4 years ago
Hi Anonymous ,
Try these calculations in new custom columns:
// Start Date List.Min({[Launch], [GW1], [GW2], [GW3]... }) // End Date List.Max({[Launch], [GW1], [GW2], [GW3]... })Pete
Syndicate_Admin
3 years agoAdministrator
I have tried your formula but it's not working for me. I am using this formula in Custom column power Query. I am Supposed to get the date 12/31/2025 but I am getting null. All my date columns are Date type.
| ID | Date1 | Date2 | Date3 | Date4 | Date5 |
| A | 1/1/1999 | null | null | 3/4/2025 | 12/31/2025 |
if [Date1] = "1/1/1999"
and [Date2] = null
and [Date3] = null
then List.Max({[Date4], [Date5]})
else null)
- BA_Pete3 years agoSuper User
Hi,
I think you need to specify the initial date type correctly, like this:
if [Date1] = #date(1999, 01, 01) and [Date2] = null and [Date3] = null then List.Max({[Date4], [Date5]}) else nullPete