Forum Discussion
Find most recent date from multiple columns
I have a worklflow which assigns a phase (Phase A) to multiple people simultaneously. Each person may approve the workflow on a different date. I need to calculate the days between the last approval of this phase and the completion date of the following phase. To do this, I'd like to create a column that displays the most recent approval date from multiple columns. Can someone tell me how I can display this date?
| Record ID | Supervisor Date | Engineer Date | Writer Date | Most Recent Date |
| Record 123 | 4/1/21 | 4/18/21 | 4/7/21 | Find most recent date |
ddownard , Try a new column like
Switch( True(),
[Supervisor Date] > [Engineer Date] && [Supervisor Date] > [Writer Date], [Supervisor Date],
[Engineer Date] > [Writer Date] ,[Engineer Date] ,
[Writer Date]
)
6 Replies
- AnonymousNot applicable
Hi ddownard
Please correct me if I wrongly understood your question.
According to your description, you hope to find the largest date in the three date columns and return this value .I create a measure that may meet your needs .
Measure = MAXX({MAX('Table'[Supervisor Date]),MAX('Table'[Engineer Date]),MAX('Table'[Writer Date])},[Value])
The effect is as shown:
Best Regards
Community Support Team _ Ailsa Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- amitchandakSuper User
ddownard , Try a new column like
Switch( True(),
[Supervisor Date] > [Engineer Date] && [Supervisor Date] > [Writer Date], [Supervisor Date],
[Engineer Date] > [Writer Date] ,[Engineer Date] ,
[Writer Date]
)- ddownardFrequent Visitor
amitchandak , can you tell me how to change your code to include three additional columns?
- Singaravelu_RResolver III
Go to query editor and duplictate the date all date column. and convert duplicate date column in to the data type as whole number.
select all duplicate date column (converted into the whole number) and click add column --> statistics --->Maximum.
Now change date type into Date to get the most recent date.
- ddownardFrequent Visitor
Thanks amitchandak. That worked! Would you mind telling me what to add for this to work with three additional date columns?
- ddownardFrequent Visitor
The solution from amitchandak is the solution that produces the desired results. Hoping someone can tell me how to add three more columns to amitchandak's solution. Thanks!