cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
mpraka
Frequent Visitor

New Calculated column for Overall Status

Hi All,

 

I have a Name, Task and Status column.

Requirement.JPG

 

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.

New.JPG

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.

Status.JPG

 

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

 

Thank you in Advance

 

Regards,

Prakash M

1 ACCEPTED SOLUTION
selimovd
Super User
Super User

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

View solution in original post

1 REPLY 1
selimovd
Super User
Super User

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

Helpful resources

Announcements
Carousel_PBI_Wave1

2023 Release Wave 1 Plans

Power BI release plans for 2023 release wave 1 describes all new features releasing from April 2023 through September 2023.

Power BI Summit Carousel 2

Global Power BI Training

Make sure you register today for the Power BI Summit 2023. Don't miss all of the great sessions and speakers!

Thank you 2022 Review

2022 Monthly Feature Releases

We had a great 2022 with a ton of feature releases to help you drive a data culture.