Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
mpraka
Advocate I
Advocate I

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.