Forum Discussion

mpraka's avatar
mpraka
Advocate II
3 years ago
Solved

New Calculated column for Overall Status

Hi All,

 

I have a Name, Task and Status column.

 

I would like to create a overall status column which compares against "Name" column and tells the overall status. If all the task is completed against that particular person then overall Status is Completed. But Even if one work item is pending then overall Status have to be Pending.

For Eg. Prakash have one Pending work item so overall status will be Pending. 

Ramesh have all the task as completed so Overall status will be completed.

 

Please let me know how to create a calculated column for this scenario.

 

Thank you in Advance

 

Regards,

Prakash M

  • Hey mpraka ,

     

    the following approach should work as calcualted column:

    Overall Status =
    -- save name of current row
    VAR vNameCurrentRow = myTable[Name]
    -- Count how many rows for the current user have the status "Pending"
    VAR vNumberPending =
        COUNTROWS (
            FILTER (
                ALL ( myTable ),
                myTable[Name] = vNameCurrentRow
                    && myTable[Status] = "Pending"
            )
        )
    -- If at least one has status pending return "Pending", otherwise "Complete"
    VAR vResult = IF ( vNumberPending > 0, "Pending", "Complete" )
    RETURN
        vResult

     

    Next time please post the data as table and not as picture, that makes it easier when someone wants to recreate your situation and can just copy the values.

     

    If you need any help please let me know.
    If I answered your question I would be happy if you could mark my post as a solution βœ”οΈ and give it a thumbs up πŸ‘

    Best regards
    Denis

    Blog: WhatTheFact.bi
    Follow me: twitter.com/DenSelimovic

1 Reply

  • selimovd's avatar
    selimovd
    Most Valuable Professional

    Hey mpraka ,

     

    the following approach should work as calcualted column:

    Overall Status =
    -- save name of current row
    VAR vNameCurrentRow = myTable[Name]
    -- Count how many rows for the current user have the status "Pending"
    VAR vNumberPending =
        COUNTROWS (
            FILTER (
                ALL ( myTable ),
                myTable[Name] = vNameCurrentRow
                    && myTable[Status] = "Pending"
            )
        )
    -- If at least one has status pending return "Pending", otherwise "Complete"
    VAR vResult = IF ( vNumberPending > 0, "Pending", "Complete" )
    RETURN
        vResult

     

    Next time please post the data as table and not as picture, that makes it easier when someone wants to recreate your situation and can just copy the values.

     

    If you need any help please let me know.
    If I answered your question I would be happy if you could mark my post as a solution βœ”οΈ and give it a thumbs up πŸ‘

    Best regards
    Denis

    Blog: WhatTheFact.bi
    Follow me: twitter.com/DenSelimovic