Forum Discussion

RohithGn's avatar
RohithGn
Helper I
6 years ago

Check multiple rows and compare them on condition

Hi All,

 

I am stuck on creating a calculated column. My table has an SR ID, Bug ID and Bug States. An SR ID could have multiptle Bugs with their respective states. My table looks like below - 

 

SR IDBug IDBug StateFinal State
1aActiveActive
2bResolvedActive
3cResolvedActive
4dResolvedResolved
5eResolvedResolved
6fResolvedResolved
7aActiveActive

 

I need to create the column Final State where I have to check all the Bug states for an SR ID and if any of the bug state for an SR ID is Active then it the result is Active but if an SR has all the bug states as Resolved then it should be Resolved.

 

any help is appreciated.

 

Regards,

Rohith

1 Reply

  • az38's avatar
    az38
    Community Champion

    Hi RohithGn 

    try new measure

     

    Measure = if(COUNTROWS(filter(ALL('Table');AND('Table'[Final State]="Active";'Table'[SR ID]=SELECTEDVALUE('Table'[SR ID]))))>0;"Active";"Resolved")

    do not hesitate to kudo useful posts and mark solutions as solution