Forum Discussion

Kusaadigarla01's avatar
Kusaadigarla01
Frequent Visitor
1 year ago
Solved

Requirement: Decomposition Tree for Process Management

Hi,

Please help in below requirement. and check the sample data below for this requirement.

Requirement: Decomposition Tree for Process Management

We need to create a decomposition tree for process management. Let's say we have three levels of dimensions, as shown in the image below.

  • If the status is "Completed", the corresponding bar in the decomposition tree should be displayed in green; otherwise, it should be red.

  • This rule should also apply to previous levels.

For example:

  • Level 1 should be red because Task 2 and Task 3 at Level 2 contain incomplete statuses.

  • After expanding Level 1, the bar for Task 1 should be green, while Task 2 and Task 3 should be red, along with their respective statuses.

Level 1Level 2Level 3Level 3 Status
LeadTask 1Task aCompleted
LeadTask 1Task bCompleted
LeadTask 1Task cCompleted
LeadTask 2Task aCompleted
LeadTask 2Task bNot Completed
LeadTask 2Task cCompleted
LeadTask 3Task aNot Completed
LeadTask 3Task bCompleted
LeadTask 3Task c

Not Completed

 

Tried but able to show status only for final level.

 

 

Regards,

Kusa

  • Hi, Thanks for your help.

    Actually it was working for sample data which i have provided in query but when i apply same logic on real time data(same kind of data) it was not working.

    Tried the different logic and it is working.

    check the logic below.

     

    TaskStatusColor_Corrected =
    VAR CurrentNodeLevel =
        SWITCH(
            TRUE(),
            NOT(ISBLANK(SELECTEDVALUE('Sheet1'[Input]))), "Input",
            NOT(ISBLANK(SELECTEDVALUE('Sheet1'[Sub Function]))), "Sub Function",
            NOT(ISBLANK(SELECTEDVALUE('Sheet1'[Business Function]))), "Business Function",
            "Head"
        )

    VAR HasPendingChildren =
        SWITCH(
            CurrentNodeLevel,
            "Input", SELECTEDVALUE('Sheet1'[Status New]) <> "Completed",
            "Sub Function",
                CALCULATE(
                    COUNTROWS(FILTER('Sheet1', 'Sheet1'[Status New] = "Pending")),
                    ALLEXCEPT('Sheet1', 'Sheet1'[Sub Function])
                ) > 0,
            "Business Function",
                CALCULATE(
                    COUNTROWS(FILTER('Sheet1', 'Sheet1'[Status New] = "Pending")),
                    ALLEXCEPT('Sheet1', 'Sheet1'[Business Function])
                ) > 0,
            "Head",
                CALCULATE(
                    COUNTROWS(FILTER('Sheet1', 'Sheet1'[Status New] = "Pending")),
                    ALL('Sheet1')
                ) > 0,
            FALSE()
        )

    RETURN
        IF(HasPendingChildren, "Red", "Green")
     
    Regards,
    Kusa

7 Replies

  • Define a measure that assigns color:

    Task_Status_Color = 
    IF(
        MAX('Table'[Level 3 Status]) = "Completed", 
        "Green", 
        "Red"
    )

    Then another measure for levels 1 and 2 that uses aggregate logic

    Level_Status_Color = 
    IF(
        MINX(FILTER('Table', 'Table'[Level 2] = SELECTEDVALUE('Table'[Level 2])), 'Table'[Level 3 Status]) = "Completed",
        "Green",
        "Red"
    )

    Set up your decomposition tree using a conditional formatting rule on bars based on the color measure.

     

    Please mark this post as solution if it helps you. Appreciate Kudos.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Kusaadigarla01 

    May I ask if you have resolved this issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.

    Thank you.

    • Kusaadigarla01's avatar
      Kusaadigarla01
      Frequent Visitor

      Hi, Thanks for your help.

      Actually it was working for sample data which i have provided in query but when i apply same logic on real time data(same kind of data) it was not working.

      Tried the different logic and it is working.

      check the logic below.

       

      TaskStatusColor_Corrected =
      VAR CurrentNodeLevel =
          SWITCH(
              TRUE(),
              NOT(ISBLANK(SELECTEDVALUE('Sheet1'[Input]))), "Input",
              NOT(ISBLANK(SELECTEDVALUE('Sheet1'[Sub Function]))), "Sub Function",
              NOT(ISBLANK(SELECTEDVALUE('Sheet1'[Business Function]))), "Business Function",
              "Head"
          )

      VAR HasPendingChildren =
          SWITCH(
              CurrentNodeLevel,
              "Input", SELECTEDVALUE('Sheet1'[Status New]) <> "Completed",
              "Sub Function",
                  CALCULATE(
                      COUNTROWS(FILTER('Sheet1', 'Sheet1'[Status New] = "Pending")),
                      ALLEXCEPT('Sheet1', 'Sheet1'[Sub Function])
                  ) > 0,
              "Business Function",
                  CALCULATE(
                      COUNTROWS(FILTER('Sheet1', 'Sheet1'[Status New] = "Pending")),
                      ALLEXCEPT('Sheet1', 'Sheet1'[Business Function])
                  ) > 0,
              "Head",
                  CALCULATE(
                      COUNTROWS(FILTER('Sheet1', 'Sheet1'[Status New] = "Pending")),
                      ALL('Sheet1')
                  ) > 0,
              FALSE()
          )

      RETURN
          IF(HasPendingChildren, "Red", "Green")
       
      Regards,
      Kusa
      • Anonymous's avatar
        Anonymous
        Not applicable

        Hi Kusaadigarla01 

        As you mentioned that using different logic worked, please accept helpful post as the solution. This will help other community members with similar problems solve them faster.

        Thank you.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Kusaadigarla01 

    Thank you for sharing valuable insights. I hope your issue has been resolved.If so, please accept it as the solution. This will assist other community members with similar problems to solve them faster.

    Thank you.