Forum Discussion

mhanne's avatar
mhanne
Frequent Visitor
5 years ago
Solved

Create a "Project Completion Date" Column Based on Most Recent Activity Completion Date in Project

 

My data looks like this

Project IDActivity IDActivity Status

Person Assigned

Activity Completion DateProject Status
1aCompleteMike10/1Complete
1bCompleteMike10/3Complete
1aCompleteBrent10/1Complete
1bCompleteBrent10/5Complete
2aCompleteMike10/3Active
2bCompleteMike10/4Active
2aCompleteBrent10/3Active
2bActiveBrent Active

Any help would be appreciated! 

  • Anonymous's avatar
    Anonymous
    5 years ago

    mhanne The reverse date is due to condition with "Earlier". Fixed the DAX as following:

    ProjectCompletionDate = CALCULATE(MAX(Sheet5[Activity Completion Date]),
    FILTER(Sheet5, Sheet5[Project Status]="Complete"
    && Sheet5[Project ID]=EARLIER(Sheet5[Project ID])))
     
     
    Did I solve your problem?
    If yes, please give kudos and mark my reply Accepted!

7 Replies

  • mhanne's avatar
    mhanne
    Frequent Visitor

    My data looks like this

    Project IDActivity IDActivity Status

    Person Assigned

    Activity Completion DateProject Status
    1aCompleteMike10/1Complete
    1bCompleteMike10/3Complete
    1aCompleteBrent10/1Complete
    1bCompleteBrent10/5Complete
    2aCompleteMike10/3Active
    2bCompleteMike10/4Active
    2aCompleteBrent10/3Active
    2bActiveBrent Active

    Any help would be appreciated! 

  • Anonymous's avatar
    Anonymous
    Not applicable

    mhanne Please create a calculated column with following DAX:

    Project Completion Date = IF(Table3[Project Status]= "Complete", MAX(Table3[Activity Completion Date]))
     
    This will give the desired result.
     
     
     
    Did I answer your question?
    If yes, please mark my solution Accepted!
    • mhanne's avatar
      mhanne
      Frequent Visitor

      Anonymous 

      When I do this, it fills the entire row with a random date that is not the completion date for any activities. I need the Project completion date to be unique to the projects based on the last completed activity in each project. So if there are 2 projects, I would want the Project Completed Date Column to say 10/5 for project 1 and 10/8 for project two. Like this: 

       

      Project IDActivity IDActivity Status

      Person Assigned

      Activity Completion DateProject StatusProject Completed Date
      1aCompleteMike10/1Complete10/5
      1bCompleteMike10/3Complete10/5
      1aCompleteBrent10/1Complete10/5
      1bCompleteBrent10/5Complete10/5
      2aCompleteMike10/3Complete10/8
      2bCompleteMike10/4Complete10/8
      2aCompleteBrent10/3Complete10/8
      2bCompleteBrent10/8Complete10/8

       

      Thank you so much for your help!

      • Anonymous's avatar
        Anonymous
        Not applicable

        mhanne  try disabling the Auto date/time intellignece from Options to avoid max date of the year. Please note the DAX does not have ".[Date]". You can try the following DAX :

        ProjectCompletionDate =
        CALCULATE(MAX(Sheet5[Activity Completion Date]),
        FILTER(Sheet5,
        Sheet5[Project ID]<>EARLIER(Sheet5[Project ID])
        && Sheet5[Project Status]="Complete"))
         
        Did I solve your problem?
        If yes, please mark my solution Accepted!