Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Calculated column based on conditions in Child rows

Hi all   I am currently creating a dashboard of data extracted from DevOps. I am trying to create a visual for our product owners, where it shows all of the features (parents) where all the underly...
  • v-yueyunzh-msft's avatar
    3 years ago

    Hi , Anonymous 

    Here are the steps you can refer to :

    (1)This is my test data:

    (2)We can creat a calculated column to falg  the 'State' field:

    Flag = IF('Sheet1'[State]="Active" , 1 ,0)

    (3)We can create another calculated column and then we can meet your need:

    Feature Satus = 
    var _count = PATHLENGTH('Sheet1'[Path])
    var _last_level  = CONVERT( PATHITEM( 'Sheet1'[Path] , _count) ,INTEGER)+0
    var _t2 =SUMX( FILTER('Sheet1' , PATHCONTAINS('Sheet1'[Path] , _last_level) && PATHLENGTH('Sheet1'[Path])<> _count ) , [Flag])
    return 
     IF( 'Sheet1'[Type] = "Feature" ,  IF(_t2 =0 ,"Done" , "Is progressing" ) , BLANK())

    (4)The result is as follows:

     

    If this method does not meet your needs, you can provide us with your special sample data and the desired output sample data in the form of tables, so that we can better help you solve the problem.

     

    Best Regards,

    Aniya Zhang

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