Forum Discussion

Socrates's avatar
Socrates
Frequent Visitor
6 years ago
Solved

Set overall status if all tasks completed

I have a table where multiple people could be assigned to one project, but even if one person's part is complete the whole project is still live until everyone is done. For instance:

 

Project IDStaffStatus
1ALive
1BCompleted
1CCompleted
2DCompleted
3ELive
3FLive
4GCompleted
4HLive
4ICompleted
4JLive

 

In the above case, only project 2 is fully completed as all of the rows for its Status are set to 'Completed'

 

I'm looking to add another column which says if a project is fully completed or not but I just can't think of the syntax needed.

Any help would be great. Thank you.

  • Socrates - Should be something like:

    Column =
      VAR __Table = SUMMARIZE(FILTER('Table',[ProjectID]=EARLIER([ProjectID])),[Status])
    RETURN
      IF(MAXX(__Table,[Status])="Completed" && COUNTROWS(__Table)=1,"Completed","Live")

2 Replies

  • Greg_Deckler's avatar
    Greg_Deckler
    Icon for Community Champion rankCommunity Champion

    Socrates - Should be something like:

    Column =
      VAR __Table = SUMMARIZE(FILTER('Table',[ProjectID]=EARLIER([ProjectID])),[Status])
    RETURN
      IF(MAXX(__Table,[Status])="Completed" && COUNTROWS(__Table)=1,"Completed","Live")
  • You asked for a calculated column.  A measure would be slightly different.

     

    Completed = 
    var p = Projects[Project ID]
    var s = CALCULATETABLE(VALUES(Projects[Status]),ALL(Projects),Projects[Project ID]=p)
    return switch(TRUE(),countrows(s)>1,FALSE(),s={"Completed"},TRUE(),FALSE())