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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
margheritamart
Frequent Visitor

Project status report based on subtasks status

Hi all,

 

I am trying to create a calculated status for projects that are currently in progress based on the status of their subtasks which are stored in a separate table called 'Items'. If the status of all items is set as "Delivered" or "Invoiced" and the project status is "In progress", I would like to display in the report: "complete project". 

Tables relationship:  Items ->Orders 

 

margheritamart_0-1648817682474.png

Thanks for your help!!

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @margheritamart ,

I created a sample pbix file(see attachment) for you, please check whether that is what you want. You can create a calculated column as below:

Column = 
VAR _pitemcount =
    CALCULATE (
        DISTINCTCOUNT ( 'Items'[Item] ),
        FILTER (
            ALLSELECTED ( 'Items' ),
            'Items'[Project ID] = EARLIER ( 'Orders'[Project ID] )
        )
    )
VAR _statuscount =
    CALCULATE (
        DISTINCTCOUNT ( 'Items'[Item] ),
        FILTER (
            ALLSELECTED ( 'Items' ),
            'Items'[Project ID] = EARLIER ( 'Orders'[Project ID] )
                && 'Items'[Status] IN { "Delivered", "Invoiced" }
        )
    )
RETURN
    IF (
        _pitemcount = _statuscount
            && 'Orders'[Status] = "In progress",
        "complete project",
        'Orders'[Status]
    )

yingyinr_1-1649138601580.png

If the above one can't help you get the desired result, please provide some sample data in the table Items and Orders table and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.

How to upload PBI in Community

Best Regards

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Hi @margheritamart ,

I created a sample pbix file(see attachment) for you, please check whether that is what you want. You can create a calculated column as below:

Column = 
VAR _pitemcount =
    CALCULATE (
        DISTINCTCOUNT ( 'Items'[Item] ),
        FILTER (
            ALLSELECTED ( 'Items' ),
            'Items'[Project ID] = EARLIER ( 'Orders'[Project ID] )
        )
    )
VAR _statuscount =
    CALCULATE (
        DISTINCTCOUNT ( 'Items'[Item] ),
        FILTER (
            ALLSELECTED ( 'Items' ),
            'Items'[Project ID] = EARLIER ( 'Orders'[Project ID] )
                && 'Items'[Status] IN { "Delivered", "Invoiced" }
        )
    )
RETURN
    IF (
        _pitemcount = _statuscount
            && 'Orders'[Status] = "In progress",
        "complete project",
        'Orders'[Status]
    )

yingyinr_1-1649138601580.png

If the above one can't help you get the desired result, please provide some sample data in the table Items and Orders table and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.

How to upload PBI in Community

Best Regards

margheritamart
Frequent Visitor

Thank you!!!

I have tried but I get the error the syntax of NOT is incorrect.

My mistake, I've edited my original post to correct it

johnt75
Super User
Super User

You could create a calculate column on the Orders table as

 

Project complete = IF( 'Orders'[status] = "In progress" && 
  ISEMPTY( FILTER( RELATEDTABLE('Items'), NOT 'Item[status] IN { "Delivered", "Invoiced" })),
"complete project", "not complete project" )

 

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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