Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago

Creating Parent-child hierarchies with MS Project data

I followed this tutorial to create a Parent-Child hierarchy on Power BI using MS Project data, but I ended up with blank lines and I can't filter them otherwise it'll hide multiple tasks. In the end of that tutorial they teach how to hide them, but their data is different from mine. Instead of "amount", I have the columns: start, finish, delay and % completed, I think that's why I can't solve the blank space problem with their solution.

 

 

Any ideas on what I should do? I'm new on Power BI and I've been searching about it for days.. 

 

 

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous ,

     

    There must be two columns [Employee] and [Manager] in your table. Then you can use PATH function to get hierachy level.

    Path = PATH(Employee[EmployeeId], Employee[ManagerId])

    My Sample:

    Then use PATHITEM to catch value in each level.

    Level 1 = PATHITEM(Employee[Path], 1, 1)
    Level 2 = PATHITEM(Employee[Path], 2, 1)

    ...

    Due to there are blank values in your levels, I think you will get result in blank level.

    Try this code.

    Measure = 
    IF(ISINSCOPE(Employee[Level 4]) = BLANK(),SUM(Employee[Index]),
    IF(ISINSCOPE(Employee[Level 3]) = BLANK(),SUM(Employee[Index]),
    IF(ISINSCOPE(Employee[Level 2]) = BLANK(),SUM(Employee[Index]),
    IF(ISINSCOPE(Employee[Level 1]) = BLANK(),IF(ISBLANK(MAX(Employee[Level 2])),BLANK(), SUM(Employee[Index])),BLANK()))))

    Result is as below. Left one is like yours and right one is the result based on measure.

     

     

    Best Regards,
    Rico Zhou

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi!!

       

      My data doesn't have blank values. The column values that apears on the blank rows are from the parent task. I highlighted in the photo below where the data is and pointed to where it should be.