Case 6: portfolio report with a role
Finally the portfolio report goes to the division heads. Each should see only the projects of their division, and every project gets a cost status.
In short: a role filters a table for everyone in it, here [Division] = "IT" on the Project table. The status is IF(ISBLANK([CPI]), BLANK(), SWITCH(TRUE(), [CPI] < 0.9, "Red", [CPI] < 1, "Amber", "Green")).
The situation
The report is published to the Power BI service. The head of IT is responsible for the ERP rollout, the customer portal and the data center move and should not see projects from Marketing and Operations. Instead of maintaining a separate file per division, the report gets roles.
Task 1: the role for IT
Task The head of IT should only see the projects of their division in the published project report. Write the table filter DAX expression of the role for the Project table: only projects in the IT division.
Project 7 rows, 7 columns
| ProjectID | Project | Division | Manager | StartDate | EndDate | Budget |
|---|---|---|---|---|---|---|
| 1 | Website relaunch | Marketing | Emma Clarke | 3 Mar 2025 | 31 Oct 2025 | 157000 |
| 2 | ERP rollout | IT | Tom Walker | 5 May 2025 | 26 Jun 2026 | 341000 |
| 3 | Warehouse redesign | Operations | Emma Clarke | 1 Sep 2025 | 24 Apr 2026 | 147000 |
| 4 | Customer portal | IT | Tom Walker | 12 Jan 2026 | 18 Dec 2026 | 267000 |
| 5 | Trade show 2026 | Marketing | Emma Clarke | 2 Feb 2026 | 25 Sep 2026 | 145000 |
| 6 | Warehouse scanners | Operations | Tom Walker | 4 May 2026 | 26 Feb 2027 | 203000 |
| 7 | Data center move | IT | Emma Clarke | 1 Feb 2027 | 24 Sep 2027 | 164000 |
Task 52 rows, 7 columns
| TaskID | ProjectID | Task | StartDate | DueDate | FinishDate | PlannedHours |
|---|---|---|---|---|---|---|
| 1 | 1 | Project management | 3 Mar 2025 | 31 Oct 2025 | 12 Nov 2025 | 385 |
| 2 | 1 | Briefing | 3 Mar 2025 | 9 May 2025 | 2 May 2025 | 130 |
| 3 | 1 | Campaign concept | 7 Apr 2025 | 6 Jun 2025 | 13 Jun 2025 | 333 |
| 4 | 1 | Visual design | 12 May 2025 | 11 Jul 2025 | 4 Jul 2025 | 504 |
| 5 | 1 | Copywriting | 16 Jun 2025 | 15 Aug 2025 | 12 Aug 2025 | 288 |
| 6 | 1 | Production | 14 Jul 2025 | 19 Sep 2025 | 16 Sep 2025 | 510 |
| 7 | 1 | Launch | 18 Aug 2025 | 24 Oct 2025 | 21 Oct 2025 | 220 |
| 8 | 2 | Project management | 5 May 2025 | 26 Jun 2026 | 22 Jun 2026 | 720 |
| 9 | 2 | Requirements | 5 May 2025 | 8 Aug 2025 | 8 Aug 2025 | 504 |
| 10 | 2 | Design concept | 23 Jun 2025 | 26 Sep 2025 | 19 Sep 2025 | 322 |
| 11 | 2 | Build phase 1 | 11 Aug 2025 | 14 Nov 2025 | 20 Nov 2025 | 650 |
| 12 | 2 | Build phase 2 | 6 Oct 2025 | 2 Jan 2026 | 6 Jan 2026 | 650 |
Showing the first 12 of 52 rows.
Timesheet 673 rows, 5 columns
| EntryID | Date | TaskID | ResourceID | Hours |
|---|---|---|---|---|
| 1 | 7 Mar 2025 | 1 | 1 | 13 |
| 2 | 7 Mar 2025 | 2 | 2 | 13.5 |
| 3 | 14 Mar 2025 | 1 | 1 | 10 |
| 4 | 14 Mar 2025 | 2 | 2 | 15.5 |
| 5 | 21 Mar 2025 | 1 | 1 | 10 |
| 6 | 21 Mar 2025 | 2 | 2 | 12.5 |
| 7 | 28 Mar 2025 | 1 | 1 | 12.5 |
| 8 | 28 Mar 2025 | 2 | 2 | 14 |
| 9 | 4 Apr 2025 | 1 | 1 | 12.5 |
| 10 | 4 Apr 2025 | 2 | 2 | 14 |
| 11 | 11 Apr 2025 | 1 | 1 | 14 |
| 12 | 11 Apr 2025 | 2 | 2 | 15 |
Showing the first 12 of 673 rows.
Measures: [Actual Hours]
Resource 10 rows, 5 columns
| ResourceID | Name | Role | HourlyRate | DailyHours |
|---|---|---|---|---|
| 1 | Emma Clarke | Project manager | 95 | 8 |
| 2 | Tom Walker | Project manager | 95 | 8 |
| 3 | Lucy Evans | Developer | 85 | 8 |
| 4 | Ravi Patel | Logistics planner | 75 | 8 |
| 5 | Mia Lang | Developer | 80 | 6 |
| 6 | Sam Kerr | Consultant | 110 | 8 |
| 7 | Grace Ross | Designer | 75 | 8 |
| 8 | Ben Hughes | Logistics planner | 70 | 8 |
| 9 | Olivia Turner | Marketing | 70 | 6 |
| 10 | Jack Brooks | Purchasing | 65 | 8 |
Date 730 rows, 4 columns
| Date | Year | Month | MonthName |
|---|---|---|---|
| 1 Jan 2025 | 2025 | 1 | Jan |
| 2 Jan 2025 | 2025 | 1 | Jan |
| 3 Jan 2025 | 2025 | 1 | Jan |
| 4 Jan 2025 | 2025 | 1 | Jan |
| 5 Jan 2025 | 2025 | 1 | Jan |
| 6 Jan 2025 | 2025 | 1 | Jan |
| 7 Jan 2025 | 2025 | 1 | Jan |
| 8 Jan 2025 | 2025 | 1 | Jan |
| 9 Jan 2025 | 2025 | 1 | Jan |
| 10 Jan 2025 | 2025 | 1 | Jan |
| 11 Jan 2025 | 2025 | 1 | Jan |
| 12 Jan 2025 | 2025 | 1 | Jan |
Showing the first 12 of 730 rows.
In Power BI Desktop you create the role under Modeling, Manage roles, and test it with View as. The lesson on publishing and sharing explains how roles are assigned to people in the service and who they apply to.
Task 2: the cost status
Task In the portfolio report every project gets a cost status: "Red" for a CPI below 0.9, "Amber" below 1, otherwise "Green". Projects without a CPI (not started yet) get no status; the measure stays blank there. Create the measure "Cost Status".
Project 7 rows, 7 columns
| ProjectID | Project | Division | Manager | StartDate | EndDate | Budget |
|---|---|---|---|---|---|---|
| 1 | Website relaunch | Marketing | Emma Clarke | 3 Mar 2025 | 31 Oct 2025 | 157000 |
| 2 | ERP rollout | IT | Tom Walker | 5 May 2025 | 26 Jun 2026 | 341000 |
| 3 | Warehouse redesign | Operations | Emma Clarke | 1 Sep 2025 | 24 Apr 2026 | 147000 |
| 4 | Customer portal | IT | Tom Walker | 12 Jan 2026 | 18 Dec 2026 | 267000 |
| 5 | Trade show 2026 | Marketing | Emma Clarke | 2 Feb 2026 | 25 Sep 2026 | 145000 |
| 6 | Warehouse scanners | Operations | Tom Walker | 4 May 2026 | 26 Feb 2027 | 203000 |
| 7 | Data center move | IT | Emma Clarke | 1 Feb 2027 | 24 Sep 2027 | 164000 |
Measures: [Earned Value], [CPI]
Task 52 rows, 7 columns
| TaskID | ProjectID | Task | StartDate | DueDate | FinishDate | PlannedHours |
|---|---|---|---|---|---|---|
| 1 | 1 | Project management | 3 Mar 2025 | 31 Oct 2025 | 12 Nov 2025 | 385 |
| 2 | 1 | Briefing | 3 Mar 2025 | 9 May 2025 | 2 May 2025 | 130 |
| 3 | 1 | Campaign concept | 7 Apr 2025 | 6 Jun 2025 | 13 Jun 2025 | 333 |
| 4 | 1 | Visual design | 12 May 2025 | 11 Jul 2025 | 4 Jul 2025 | 504 |
| 5 | 1 | Copywriting | 16 Jun 2025 | 15 Aug 2025 | 12 Aug 2025 | 288 |
| 6 | 1 | Production | 14 Jul 2025 | 19 Sep 2025 | 16 Sep 2025 | 510 |
| 7 | 1 | Launch | 18 Aug 2025 | 24 Oct 2025 | 21 Oct 2025 | 220 |
| 8 | 2 | Project management | 5 May 2025 | 26 Jun 2026 | 22 Jun 2026 | 720 |
| 9 | 2 | Requirements | 5 May 2025 | 8 Aug 2025 | 8 Aug 2025 | 504 |
| 10 | 2 | Design concept | 23 Jun 2025 | 26 Sep 2025 | 19 Sep 2025 | 322 |
| 11 | 2 | Build phase 1 | 11 Aug 2025 | 14 Nov 2025 | 20 Nov 2025 | 650 |
| 12 | 2 | Build phase 2 | 6 Oct 2025 | 2 Jan 2026 | 6 Jan 2026 | 650 |
Showing the first 12 of 52 rows.
Measures: [Percent Complete]
Timesheet 673 rows, 5 columns
| EntryID | Date | TaskID | ResourceID | Hours |
|---|---|---|---|---|
| 1 | 7 Mar 2025 | 1 | 1 | 13 |
| 2 | 7 Mar 2025 | 2 | 2 | 13.5 |
| 3 | 14 Mar 2025 | 1 | 1 | 10 |
| 4 | 14 Mar 2025 | 2 | 2 | 15.5 |
| 5 | 21 Mar 2025 | 1 | 1 | 10 |
| 6 | 21 Mar 2025 | 2 | 2 | 12.5 |
| 7 | 28 Mar 2025 | 1 | 1 | 12.5 |
| 8 | 28 Mar 2025 | 2 | 2 | 14 |
| 9 | 4 Apr 2025 | 1 | 1 | 12.5 |
| 10 | 4 Apr 2025 | 2 | 2 | 14 |
| 11 | 11 Apr 2025 | 1 | 1 | 14 |
| 12 | 11 Apr 2025 | 2 | 2 | 15 |
Showing the first 12 of 673 rows.
Measures: [Actual Hours], [Actual Cost]
Resource 10 rows, 5 columns
| ResourceID | Name | Role | HourlyRate | DailyHours |
|---|---|---|---|---|
| 1 | Emma Clarke | Project manager | 95 | 8 |
| 2 | Tom Walker | Project manager | 95 | 8 |
| 3 | Lucy Evans | Developer | 85 | 8 |
| 4 | Ravi Patel | Logistics planner | 75 | 8 |
| 5 | Mia Lang | Developer | 80 | 6 |
| 6 | Sam Kerr | Consultant | 110 | 8 |
| 7 | Grace Ross | Designer | 75 | 8 |
| 8 | Ben Hughes | Logistics planner | 70 | 8 |
| 9 | Olivia Turner | Marketing | 70 | 6 |
| 10 | Jack Brooks | Purchasing | 65 | 8 |
Date 730 rows, 4 columns
| Date | Year | Month | MonthName |
|---|---|---|---|
| 1 Jan 2025 | 2025 | 1 | Jan |
| 2 Jan 2025 | 2025 | 1 | Jan |
| 3 Jan 2025 | 2025 | 1 | Jan |
| 4 Jan 2025 | 2025 | 1 | Jan |
| 5 Jan 2025 | 2025 | 1 | Jan |
| 6 Jan 2025 | 2025 | 1 | Jan |
| 7 Jan 2025 | 2025 | 1 | Jan |
| 8 Jan 2025 | 2025 | 1 | Jan |
| 9 Jan 2025 | 2025 | 1 | Jan |
| 10 Jan 2025 | 2025 | 1 | Jan |
| 11 Jan 2025 | 2025 | 1 | Jan |
| 12 Jan 2025 | 2025 | 1 | Jan |
Showing the first 12 of 730 rows.
This exercise is part of Premium.
Premium unlocks every exercise in every lesson, unlimited practice with fresh tasks and the final test with certificate.
See Premium Already Premium? Log in
The first exercise in this lesson is free.
SWITCH(TRUE(), …) checks the conditions from top to bottom, and the first one that is true wins. That is why the 0.9 limit comes before the 1 limit. More in the lesson on IF and SWITCH.
Common mistakes
Blank CPI not caught
Without IF(ISBLANK(…)) the data center move gets the status "Red", because a blank CPI is smaller than 0.9 in a comparison. The project then appears in the matrix even though it has not started.
Limits in the wrong order
If [CPI] < 1 comes before [CPI] < 0.9, the first condition also matches every CPI below 0.9. Red never appears, and the warehouse scanners at 0.65 show Amber.
In real Power BI
- Row-level security applies to people with the Viewer role in the workspace. Anyone who administers or edits the workspace sees all data.
- Through Project the role also filters Task and Timesheet. The head of IT still sees all resources, just without hours from other projects. If the list of people should be restricted too, Resource needs a rule of its own.
- In Power BI you can show the status as the background color of the cell: conditional formatting by field value, with a measure that returns a color code such as "#C0392B".
Check your result
- Task 1: With the role the 2026 matrix only shows Consultant with 1,163, Developer with 845 and Project manager with 1,494 hours, 3,502 in total.
- Task 2: The warehouse scanners are Red, the warehouse redesign Amber, and the other four projects Green. The data center move is missing from the matrix, and the total row is Amber.
Back to case 5 or the course overview.