When a project is completed or closed you might want to make the project read only and remove it from any reports. There are a few ways to handle this for removing the project from reports with adding custom fields into the CDS entities but a nice simple out of the box option is to deactivate the project as seen below:
Notice the status bar message “You can’t edit this project because it is inactive.” This is performed using the model-driven Power App for Project, see the steps below.
Access Dynamics 365 from the app launcher:
Then click the “Project” app tile:
This will launch the Project model-driven app experience:
Access the project that you want to close / make inactive – you might need to change the view etc. if you can’t find the project. Clicking the project name will launch the project:
Click the Deactivate button on the command bar as seen outlined in red in the image above. Confirm the deactivation by clicking the Deactivate button on the modal:
You will now see in the model-driven app that the project is read-only – both the data directly on the forms and also the task data in the iframe on the Tasks tab:
Now access the Project in the Project UI and you will see the project is read-only there too:
There is a delay between the project showing as inactive in the Project UI / the Tasks tab in the model-driven app but it will happen. So that is the project updated to be read-only in the Project UI and the model-driven app. Now what about filtering these projects from reports if needed? That is simple too using the default Project for the web Power BI report pack from Microsoft. Open the Power BI report pack in Project BI Desktop. Notice that the project we’ve just deactivated is still visible:
This is OK and expected, but what if we wanted to remove those inactive projects from the reports? That can be done, click “Transform data” on the Home ribbon in Power BI Desktop to launch the Power Query editor. Click the “Projects Staging” query as seen below:
Notice how the project we made inactive has a statecode of 1 and a statuscode of 2. Either of these fields can be used to determine the projects state. To filter out the inactive project we will use the statecode and filter out rows with a value of 1:
Click OK then click Close and Apply in Power Query to close the Power Query editor. Once the report refreshes you will see the inactive project removed from all reports. Now save / publish the updated Power BI report as needed.
That’s it – a nice simple way to close projects in Project for the web and filter these from reports.