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
ProjectIDProjectDivisionManagerStartDateEndDateBudget
1Website relaunchMarketingEmma Clarke3 Mar 202531 Oct 2025157000
2ERP rolloutITTom Walker5 May 202526 Jun 2026341000
3Warehouse redesignOperationsEmma Clarke1 Sep 202524 Apr 2026147000
4Customer portalITTom Walker12 Jan 202618 Dec 2026267000
5Trade show 2026MarketingEmma Clarke2 Feb 202625 Sep 2026145000
6Warehouse scannersOperationsTom Walker4 May 202626 Feb 2027203000
7Data center moveITEmma Clarke1 Feb 202724 Sep 2027164000
Task 52 rows, 7 columns
TaskIDProjectIDTaskStartDateDueDateFinishDatePlannedHours
11Project management3 Mar 202531 Oct 202512 Nov 2025385
21Briefing3 Mar 20259 May 20252 May 2025130
31Campaign concept7 Apr 20256 Jun 202513 Jun 2025333
41Visual design12 May 202511 Jul 20254 Jul 2025504
51Copywriting16 Jun 202515 Aug 202512 Aug 2025288
61Production14 Jul 202519 Sep 202516 Sep 2025510
71Launch18 Aug 202524 Oct 202521 Oct 2025220
82Project management5 May 202526 Jun 202622 Jun 2026720
92Requirements5 May 20258 Aug 20258 Aug 2025504
102Design concept23 Jun 202526 Sep 202519 Sep 2025322
112Build phase 111 Aug 202514 Nov 202520 Nov 2025650
122Build phase 26 Oct 20252 Jan 20266 Jan 2026650

Showing the first 12 of 52 rows.

Timesheet 673 rows, 5 columns
EntryIDDateTaskIDResourceIDHours
17 Mar 20251113
27 Mar 20252213.5
314 Mar 20251110
414 Mar 20252215.5
521 Mar 20251110
621 Mar 20252212.5
728 Mar 20251112.5
828 Mar 20252214
94 Apr 20251112.5
104 Apr 20252214
1111 Apr 20251114
1211 Apr 20252215

Showing the first 12 of 673 rows.

Measures: [Actual Hours]

Resource 10 rows, 5 columns
ResourceIDNameRoleHourlyRateDailyHours
1Emma ClarkeProject manager958
2Tom WalkerProject manager958
3Lucy EvansDeveloper858
4Ravi PatelLogistics planner758
5Mia LangDeveloper806
6Sam KerrConsultant1108
7Grace RossDesigner758
8Ben HughesLogistics planner708
9Olivia TurnerMarketing706
10Jack BrooksPurchasing658
Date 730 rows, 4 columns
DateYearMonthMonthName
1 Jan 202520251Jan
2 Jan 202520251Jan
3 Jan 202520251Jan
4 Jan 202520251Jan
5 Jan 202520251Jan
6 Jan 202520251Jan
7 Jan 202520251Jan
8 Jan 202520251Jan
9 Jan 202520251Jan
10 Jan 202520251Jan
11 Jan 202520251Jan
12 Jan 202520251Jan

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
ProjectIDProjectDivisionManagerStartDateEndDateBudget
1Website relaunchMarketingEmma Clarke3 Mar 202531 Oct 2025157000
2ERP rolloutITTom Walker5 May 202526 Jun 2026341000
3Warehouse redesignOperationsEmma Clarke1 Sep 202524 Apr 2026147000
4Customer portalITTom Walker12 Jan 202618 Dec 2026267000
5Trade show 2026MarketingEmma Clarke2 Feb 202625 Sep 2026145000
6Warehouse scannersOperationsTom Walker4 May 202626 Feb 2027203000
7Data center moveITEmma Clarke1 Feb 202724 Sep 2027164000

Measures: [Earned Value], [CPI]

Task 52 rows, 7 columns
TaskIDProjectIDTaskStartDateDueDateFinishDatePlannedHours
11Project management3 Mar 202531 Oct 202512 Nov 2025385
21Briefing3 Mar 20259 May 20252 May 2025130
31Campaign concept7 Apr 20256 Jun 202513 Jun 2025333
41Visual design12 May 202511 Jul 20254 Jul 2025504
51Copywriting16 Jun 202515 Aug 202512 Aug 2025288
61Production14 Jul 202519 Sep 202516 Sep 2025510
71Launch18 Aug 202524 Oct 202521 Oct 2025220
82Project management5 May 202526 Jun 202622 Jun 2026720
92Requirements5 May 20258 Aug 20258 Aug 2025504
102Design concept23 Jun 202526 Sep 202519 Sep 2025322
112Build phase 111 Aug 202514 Nov 202520 Nov 2025650
122Build phase 26 Oct 20252 Jan 20266 Jan 2026650

Showing the first 12 of 52 rows.

Measures: [Percent Complete]

Timesheet 673 rows, 5 columns
EntryIDDateTaskIDResourceIDHours
17 Mar 20251113
27 Mar 20252213.5
314 Mar 20251110
414 Mar 20252215.5
521 Mar 20251110
621 Mar 20252212.5
728 Mar 20251112.5
828 Mar 20252214
94 Apr 20251112.5
104 Apr 20252214
1111 Apr 20251114
1211 Apr 20252215

Showing the first 12 of 673 rows.

Measures: [Actual Hours], [Actual Cost]

Resource 10 rows, 5 columns
ResourceIDNameRoleHourlyRateDailyHours
1Emma ClarkeProject manager958
2Tom WalkerProject manager958
3Lucy EvansDeveloper858
4Ravi PatelLogistics planner758
5Mia LangDeveloper806
6Sam KerrConsultant1108
7Grace RossDesigner758
8Ben HughesLogistics planner708
9Olivia TurnerMarketing706
10Jack BrooksPurchasing658
Date 730 rows, 4 columns
DateYearMonthMonthName
1 Jan 202520251Jan
2 Jan 202520251Jan
3 Jan 202520251Jan
4 Jan 202520251Jan
5 Jan 202520251Jan
6 Jan 202520251Jan
7 Jan 202520251Jan
8 Jan 202520251Jan
9 Jan 202520251Jan
10 Jan 202520251Jan
11 Jan 202520251Jan
12 Jan 202520251Jan

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.

Done: all six cases

Your course view shows which tasks are still open and where you request the "Power BI for Project Management" certificate.

Go to the course view

Back to case 5 or the course overview.

Write to us

Choose language

Select your preferred language