Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Max Health Value based on Main Project

Hello

 

I can't find a working solution for my problem.

 

I have a table named ht_ProjectData with Projects and Phases.

I want a additional column for the "Project Health". It should show the highest value from all Phases related to this Project.

The table looks like this:

MainProjectTaskNameHealthProjectType
Project AProject A-Project
Project APhase 11Phase
Project APhase 21Phase
Project APhase 32Phase
Project BProject B-Project
Project BPhase 13Phase
Project BPhase 21Phase
Project BPhase 31Phase

 

At the end it should look like this:

MainProjectTaskNameHealthProjectTypeMainProjectHealth
Project AProject A-Project2
Project APhase 11Phase-
Project APhase 21Phase-
Project APhase 32Phase-
Project BProject B-Project3
Project BPhase 13Phase-
Project BPhase 21Phase-
Project BPhase 31Phase-

 

 

I tried this Calculation but it didn't work:

MainProjectHealth = CALCULATE(
                                      MAX(
                                         ht_ProjectData[Health];
                                         FILTER(
                                            ht_ProjectData;
                                            ht_ProjectData[ProjectType] = "Phase" &&
                                            ht_ProjectData[MainProject] = ht_ProjectData[TaskName]
                                            )
                                        )
                                   )

Any suggestions?

  • I believe:

     

     

    MainProjectHealth Column =
      IF(
        [ProjectType] = "Project",
        MAXX(
          FILTER(
            'Table',
            [MainProject] = EARLIER([MainProject]) &&
            [ProjectType] = "Phase"
          ),
          [Health]
        ),
        BLANK()
      )

     

2 Replies

  • Greg_Deckler's avatar
    Greg_Deckler
    Community Champion

    I believe:

     

     

    MainProjectHealth Column =
      IF(
        [ProjectType] = "Project",
        MAXX(
          FILTER(
            'Table',
            [MainProject] = EARLIER([MainProject]) &&
            [ProjectType] = "Phase"
          ),
          [Health]
        ),
        BLANK()
      )