Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Create Custom Column based on specific combinations of values from another column

Hello, How can a new Task Status column be created based on the table and criteria below:

TaskRegionCountryTask StatusNEW DESIRED COLUMN
1EMEAFinlandCompleteIn Progress
1EMEASwedenIssuesIn Progress
1

EMEA

GermanyNot StartedIn Progress
2EMEAFinlandCompleteIn Progress
2EMEASwedenIssuesIn Progress
2EMEAGermanyNot StartedIn Progress
2EMEASpainCompleteCompleted
3EMEASwedenCompleteCompleted
3EMEASpainCompleteCompleted


I need to create a new coulmn to show me for each TASK:
If Task Status column contains "Not Started", "Issues" & "Completed" then = "In Progress"
If Task Status column contains "Not Started" & "Issues" then = "In Progress"
If Task Status column contains "Not Started" & "Completed" then = "In Progress"
If Task Status column contains "Issues" & "Completed" then = "In Progress"
If Task Status column contains "Not Started" ONLY then = "Not Started"
If Task Status column contains "Issues" ONLY then = "Issues"
If Task Status column contains "Completed" ONLY then = "Completed"

End Result needed to Display:

TaskRegionNew Task Status
1EMEAIn Progress
2EMEAIn Progress
3EMEACompleted
 
  • = Table.Group(Source,{"Task","Region"},{"Task Status",each let a=List.Distinct([Task Status]) in if a{1}?=null then a{0} else "In Progress"})

2 Replies

  • wdx223_Daniel's avatar
    wdx223_Daniel
    Community Champion

    = Table.Group(Source,{"Task","Region"},{"Task Status",each let a=List.Distinct([Task Status]) in if a{1}?=null then a{0} else "In Progress"})

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hey, you can group by task column first, then use conditional column to have a new column "task status".