Forum Discussion
Earlier Function
- 6 years ago
Hi, Anonymous
Based on your description, I created data to reproduce your scenario. The pbix file is attached in the end.
Table:
You may create a calculated column as below.
End Date = CALCULATE( MIN('Table'[DateTime]), FILTER( ALL('Table'), 'Table'[Person]=EARLIER('Table'[Person])&& 'Table'[Phase]=EARLIER('Table'[Phase])&& 'Table'[Status]="Complete"&& 'Table'[DateTime]>=EARLIER('Table'[DateTime]) ) )Result:
Best Regards
Allan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous , try new column like
maxx(filter(Table, [Name] =earlier([Name]) && [Phase] =earlier([Phase]) && [Status]="Complete"),[DateTime])
or
maxx(filter(Table, [Phase] =earlier([Phase]) && [Status]="Complete"),[DateTime])
Thank you for the prompt response. I have to make a status bar. That's why I need to know the start time and the end time of a phase. The maxx(filter(Table, [Phase] ?earlier([Phase]) && [Status]"Complete"),[DateTime]) function would solve the problem if that phase only occurred once, but in my case that phase occurs in several days and on some days several times during that day. So the maxx(filter(Table, [Phase] ?earlier([Phase]) && [Status]"Complete"),[DateTime]) function would give me the maximum date of the last time the phase is completed. Any idea for that every time there is that phase me from the date of the next state completed that phase? Thanks for the help.