Case 6: division report with a role
Finally the report goes to the division heads. Each should see only their costs, the title should say which division is shown, and the share of every cost center should refer to the costs of the whole company.
In short: a role filters a table for everyone in it, here [Division] = "Operations" on the CostCenter table. The title comes from "Cost report " & SELECTEDVALUE(CostCenter[Division], "all divisions"), the share of all costs from DIVIDE([Total Actual], CALCULATE([Total Actual], ALL(CostCenter))).
The situation
The report is published to the Power BI service. The head of operations is responsible for Production and Warehouse and should not see numbers from Sales and Administration. Instead of maintaining a separate file per division, the report gets roles.
Task 1: the role for operations
Task The head of operations should only see the costs of their division in the published report. Write the table filter DAX expression of the role for the table CostCenter: only cost centers in the Operations division.
Actual 535 rows, 5 columns
| EntryID | Date | CostCenterID | AccountID | Amount |
|---|---|---|---|---|
| 1 | 23 Jan 2025 | 300 | 4000 | 88400 |
| 2 | 22 Jan 2025 | 300 | 4000 | 132600 |
| 3 | 12 Jan 2025 | 200 | 5000 | 36176 |
| 4 | 4 Jan 2025 | 600 | 5000 | 5253.5 |
| 5 | 21 Jan 2025 | 100 | 6000 | 13276.2 |
| 6 | 30 Jan 2025 | 100 | 6000 | 9613.8 |
| 7 | 16 Jan 2025 | 200 | 6000 | 49220 |
| 8 | 20 Jan 2025 | 300 | 6000 | 25440 |
| 9 | 29 Jan 2025 | 400 | 6000 | 12875 |
| 10 | 29 Jan 2025 | 500 | 6000 | 17205 |
| 11 | 10 Jan 2025 | 600 | 6000 | 5045.04 |
| 12 | 14 Jan 2025 | 600 | 6000 | 4656.96 |
Showing the first 12 of 535 rows.
Measures: [Total Actual]
Budget 432 rows, 4 columns
| Date | CostCenterID | AccountID | Amount |
|---|---|---|---|
| 1 Jan 2025 | 300 | 4000 | 221000 |
| 1 Jan 2025 | 200 | 5000 | 32300 |
| 1 Jan 2025 | 600 | 5000 | 5530 |
| 1 Jan 2025 | 100 | 6000 | 21000 |
| 1 Jan 2025 | 200 | 6000 | 46000 |
| 1 Jan 2025 | 300 | 6000 | 24000 |
| 1 Jan 2025 | 400 | 6000 | 12500 |
| 1 Jan 2025 | 500 | 6000 | 15500 |
| 1 Jan 2025 | 600 | 6000 | 9800 |
| 1 Jan 2025 | 100 | 6300 | 4200 |
| 1 Jan 2025 | 200 | 6300 | 7800 |
| 1 Jan 2025 | 600 | 6300 | 3600 |
Showing the first 12 of 432 rows.
Measures: [Total Budget]
CostCenter 6 rows, 3 columns
| CostCenterID | CostCenter | Division |
|---|---|---|
| 100 | Administration | Administration |
| 200 | Production | Operations |
| 300 | Sales | Sales |
| 400 | Marketing | Sales |
| 500 | IT | Administration |
| 600 | Warehouse | Operations |
Account 7 rows, 4 columns
| AccountID | Account | AccountType | AccountGroup |
|---|---|---|---|
| 4000 | Revenue | Income | Revenue |
| 5000 | Materials | Expense | Materials |
| 6000 | Salaries and Wages | Expense | Personnel |
| 6300 | Rent | Expense | Operating |
| 6500 | Travel | Expense | Operating |
| 6800 | Advertising | Expense | Operating |
| 6900 | Other Expenses | Expense | Operating |
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 title
Task The title above the report should show which division is selected. Create the measure "Report Title": the text "Cost report " followed by the selected division, or "all divisions" when none or several are selected.
Actual 535 rows, 5 columns
| EntryID | Date | CostCenterID | AccountID | Amount |
|---|---|---|---|---|
| 1 | 23 Jan 2025 | 300 | 4000 | 88400 |
| 2 | 22 Jan 2025 | 300 | 4000 | 132600 |
| 3 | 12 Jan 2025 | 200 | 5000 | 36176 |
| 4 | 4 Jan 2025 | 600 | 5000 | 5253.5 |
| 5 | 21 Jan 2025 | 100 | 6000 | 13276.2 |
| 6 | 30 Jan 2025 | 100 | 6000 | 9613.8 |
| 7 | 16 Jan 2025 | 200 | 6000 | 49220 |
| 8 | 20 Jan 2025 | 300 | 6000 | 25440 |
| 9 | 29 Jan 2025 | 400 | 6000 | 12875 |
| 10 | 29 Jan 2025 | 500 | 6000 | 17205 |
| 11 | 10 Jan 2025 | 600 | 6000 | 5045.04 |
| 12 | 14 Jan 2025 | 600 | 6000 | 4656.96 |
Showing the first 12 of 535 rows.
Measures: [Total Actual]
Budget 432 rows, 4 columns
| Date | CostCenterID | AccountID | Amount |
|---|---|---|---|
| 1 Jan 2025 | 300 | 4000 | 221000 |
| 1 Jan 2025 | 200 | 5000 | 32300 |
| 1 Jan 2025 | 600 | 5000 | 5530 |
| 1 Jan 2025 | 100 | 6000 | 21000 |
| 1 Jan 2025 | 200 | 6000 | 46000 |
| 1 Jan 2025 | 300 | 6000 | 24000 |
| 1 Jan 2025 | 400 | 6000 | 12500 |
| 1 Jan 2025 | 500 | 6000 | 15500 |
| 1 Jan 2025 | 600 | 6000 | 9800 |
| 1 Jan 2025 | 100 | 6300 | 4200 |
| 1 Jan 2025 | 200 | 6300 | 7800 |
| 1 Jan 2025 | 600 | 6300 | 3600 |
Showing the first 12 of 432 rows.
Measures: [Total Budget]
CostCenter 6 rows, 3 columns
| CostCenterID | CostCenter | Division |
|---|---|---|
| 100 | Administration | Administration |
| 200 | Production | Operations |
| 300 | Sales | Sales |
| 400 | Marketing | Sales |
| 500 | IT | Administration |
| 600 | Warehouse | Operations |
Account 7 rows, 4 columns
| AccountID | Account | AccountType | AccountGroup |
|---|---|---|---|
| 4000 | Revenue | Income | Revenue |
| 5000 | Materials | Expense | Materials |
| 6000 | Salaries and Wages | Expense | Personnel |
| 6300 | Rent | Expense | Operating |
| 6500 | Travel | Expense | Operating |
| 6800 | Advertising | Expense | Operating |
| 6900 | Other Expenses | Expense | Operating |
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.
SELECTEDVALUE returns the division when exactly one is in the filter, otherwise the alternate value. With the role from task 1, the head of operations only ever sees one division, and the title reads "Cost report Operations". The lesson on building a dashboard shows how to use a measure as a title.
Task 3: the share of total costs
Task How much does each cost center contribute to the total costs of 2026? Create the measure "Cost Share": [Total Actual] of the row divided by [Total Actual] of all cost centers.
Actual 535 rows, 5 columns
| EntryID | Date | CostCenterID | AccountID | Amount |
|---|---|---|---|---|
| 1 | 23 Jan 2025 | 300 | 4000 | 88400 |
| 2 | 22 Jan 2025 | 300 | 4000 | 132600 |
| 3 | 12 Jan 2025 | 200 | 5000 | 36176 |
| 4 | 4 Jan 2025 | 600 | 5000 | 5253.5 |
| 5 | 21 Jan 2025 | 100 | 6000 | 13276.2 |
| 6 | 30 Jan 2025 | 100 | 6000 | 9613.8 |
| 7 | 16 Jan 2025 | 200 | 6000 | 49220 |
| 8 | 20 Jan 2025 | 300 | 6000 | 25440 |
| 9 | 29 Jan 2025 | 400 | 6000 | 12875 |
| 10 | 29 Jan 2025 | 500 | 6000 | 17205 |
| 11 | 10 Jan 2025 | 600 | 6000 | 5045.04 |
| 12 | 14 Jan 2025 | 600 | 6000 | 4656.96 |
Showing the first 12 of 535 rows.
Measures: [Total Actual]
Budget 432 rows, 4 columns
| Date | CostCenterID | AccountID | Amount |
|---|---|---|---|
| 1 Jan 2025 | 300 | 4000 | 221000 |
| 1 Jan 2025 | 200 | 5000 | 32300 |
| 1 Jan 2025 | 600 | 5000 | 5530 |
| 1 Jan 2025 | 100 | 6000 | 21000 |
| 1 Jan 2025 | 200 | 6000 | 46000 |
| 1 Jan 2025 | 300 | 6000 | 24000 |
| 1 Jan 2025 | 400 | 6000 | 12500 |
| 1 Jan 2025 | 500 | 6000 | 15500 |
| 1 Jan 2025 | 600 | 6000 | 9800 |
| 1 Jan 2025 | 100 | 6300 | 4200 |
| 1 Jan 2025 | 200 | 6300 | 7800 |
| 1 Jan 2025 | 600 | 6300 | 3600 |
Showing the first 12 of 432 rows.
Measures: [Total Budget]
CostCenter 6 rows, 3 columns
| CostCenterID | CostCenter | Division |
|---|---|---|
| 100 | Administration | Administration |
| 200 | Production | Operations |
| 300 | Sales | Sales |
| 400 | Marketing | Sales |
| 500 | IT | Administration |
| 600 | Warehouse | Operations |
Account 7 rows, 4 columns
| AccountID | Account | AccountType | AccountGroup |
|---|---|---|---|
| 4000 | Revenue | Income | Revenue |
| 5000 | Materials | Expense | Materials |
| 6000 | Salaries and Wages | Expense | Personnel |
| 6300 | Rent | Expense | Operating |
| 6500 | Travel | Expense | Operating |
| 6800 | Advertising | Expense | Operating |
| 6900 | Other Expenses | Expense | Operating |
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.
ALL(CostCenter) only removes the cost center filter; year and account type stay. The lesson on percent of total explains how ALL works in the denominator.
Common mistakes
Role on the wrong table
The rule [Division] = "Operations" belongs to the CostCenter table, because only that table has the Division column. On Actual or Account it is an error.
Text joined without a space
"Cost report" & division gives "Cost reportOperations". The space belongs in the text: "Cost report ".
Share with a fixed total
Dividing by the total as a number gives a share that is only right for 2026 and only for this data.
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.
- The role filters the whole model, and ALL does not remove that filter. For the head of operations the denominator from task 3 is therefore the total of Production and Warehouse, not of the whole company. Always test such measures with View as.
Check your result
- Task 1: With the role the 2026 matrix shows Materials 569,973.30, Personnel 666,580.10 and Operating 140,815.40. Revenue disappears.
- Task 2: The rows read "Cost report Operations", "Cost report Administration" and "Cost report Sales", the total row "Cost report all divisions".
- Task 3: Production carries 44.2% of the 2026 costs, IT 9.2%.
Back to case 5 or the course overview.