Forum Discussion

ElliotK's avatar
ElliotK
Helper I
4 years ago
Solved

Create new column for MAXDate

Hello,

 

I wish to create a column that calculates that Max Data where the TaskPosition is "Completed" for TaskGroupID 13, within eID 53. 

 

IDeIDTaskGroupIDTaskStatusIDTaskStatusStartDateEndDateTaskPosition
10015311ProcessingNULLNULL 
10025321ProcessingNULLNULL 
10035331ProcessingNULLNULL 
10045342QualityNULLNULL 
10055352QualityNULLNULL 
10065362QualityNULLNULL 
10075372QualityNULLNULL 
10085382QualityNULLNULL 
10095393IssuanceNULLNULL 
101053103IssuanceNULLNULL 
101153113IssuanceNULLNULL 
101253124SigningNULLNULL 
101353134SigningNULL01/08/2022Completed

 

If there is a record after completed, do not show the max. 

 

IDeIDTaskGroupIDTaskStatusIDTaskStatusStartDateEndDateTaskPosition
10015311ProcessingNULLNULL 
10025321ProcessingNULLNULL 
10035331ProcessingNULLNULL 
10045342QualityNULLNULL 
10055352QualityNULLNULL 
10065362QualityNULLNULL 
10075372QualityNULLNULL 
10085382QualityNULLNULL 
10095393IssuanceNULLNULL 
101053103IssuanceNULLNULL 
101153113IssuanceNULLNULL 
101253124SigningNULLNULL 
101353134SigningNULL01/08/2022Completed
101353134SigningNullNULL 

 

I wanted to do this as a column as I wish to calculate the difference between the very first start date and the very last end date where the status is completed. 

 

Any help appreciated. 

  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi ElliotK ,

     

    Please try

    Column = CALCULATE(MAX('Table (2)'[EndDate]),FILTER('Table (2)',[TaskPosition]="Completed"&&[eID]=EARLIER('Table (2)'[eID])))

     

     

     

    Best Regards,

    Stephen Tao

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

1 Reply

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi ElliotK ,

     

    Please try

    Column = CALCULATE(MAX('Table (2)'[EndDate]),FILTER('Table (2)',[TaskPosition]="Completed"&&[eID]=EARLIER('Table (2)'[eID])))

     

     

     

    Best Regards,

    Stephen Tao

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.