Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
mhanne
Frequent Visitor

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! 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

@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])))
 
Capture.PNG
 
Did I solve your problem?
If yes, please give kudos and mark my reply Accepted!

View solution in original post

7 REPLIES 7
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!

@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!

Hi, @mhanne 

Could you please tell me whether your problem has been solved?
If yes, you could accept the helpful answer as solution. You also could share your own solution here. For now, there is no content of description in the thread. If you still need help, please share more details to us.

 

Best Regards,
Community Support Team _ Eason

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"))
 
Capture.PNG
Did I solve your problem?
If yes, please mark my solution Accepted!

@Anonymous 

Here is the formula when I use my own fields:

 
power BI.JPG
It is still giving me the same date in every row. When I turned off Auto date/time intelligence it gave me a number rather than a date and would not let me change the Data Type (when I tried the table wouldn't work until I removed the column). 
I'm also a bit confused by your example, because the completion dates are switched in your table ( Project 1 should be 10/5/2020 and Project 2 should be 10/8/2020)
Anonymous
Not applicable

@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])))
 
Capture.PNG
 
Did I solve your problem?
If yes, please give kudos and mark my reply Accepted!
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! 

Helpful resources

Announcements
July 2024 Power BI Update

Power BI Monthly Update - July 2024

Check out the July 2024 Power BI update to learn about new features.

July Newsletter

Fabric Community Update - July 2024

Find out what's new and trending in the Fabric Community.