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
EntryIDDateCostCenterIDAccountIDAmount
123 Jan 2025300400088400
222 Jan 20253004000132600
312 Jan 2025200500036176
44 Jan 202560050005253.5
521 Jan 2025100600013276.2
630 Jan 202510060009613.8
716 Jan 2025200600049220
820 Jan 2025300600025440
929 Jan 2025400600012875
1029 Jan 2025500600017205
1110 Jan 202560060005045.04
1214 Jan 202560060004656.96

Showing the first 12 of 535 rows.

Measures: [Total Actual]

Budget 432 rows, 4 columns
DateCostCenterIDAccountIDAmount
1 Jan 20253004000221000
1 Jan 2025200500032300
1 Jan 202560050005530
1 Jan 2025100600021000
1 Jan 2025200600046000
1 Jan 2025300600024000
1 Jan 2025400600012500
1 Jan 2025500600015500
1 Jan 202560060009800
1 Jan 202510063004200
1 Jan 202520063007800
1 Jan 202560063003600

Showing the first 12 of 432 rows.

Measures: [Total Budget]

CostCenter 6 rows, 3 columns
CostCenterIDCostCenterDivision
100AdministrationAdministration
200ProductionOperations
300SalesSales
400MarketingSales
500ITAdministration
600WarehouseOperations
Account 7 rows, 4 columns
AccountIDAccountAccountTypeAccountGroup
4000RevenueIncomeRevenue
5000MaterialsExpenseMaterials
6000Salaries and WagesExpensePersonnel
6300RentExpenseOperating
6500TravelExpenseOperating
6800AdvertisingExpenseOperating
6900Other ExpensesExpenseOperating
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 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
EntryIDDateCostCenterIDAccountIDAmount
123 Jan 2025300400088400
222 Jan 20253004000132600
312 Jan 2025200500036176
44 Jan 202560050005253.5
521 Jan 2025100600013276.2
630 Jan 202510060009613.8
716 Jan 2025200600049220
820 Jan 2025300600025440
929 Jan 2025400600012875
1029 Jan 2025500600017205
1110 Jan 202560060005045.04
1214 Jan 202560060004656.96

Showing the first 12 of 535 rows.

Measures: [Total Actual]

Budget 432 rows, 4 columns
DateCostCenterIDAccountIDAmount
1 Jan 20253004000221000
1 Jan 2025200500032300
1 Jan 202560050005530
1 Jan 2025100600021000
1 Jan 2025200600046000
1 Jan 2025300600024000
1 Jan 2025400600012500
1 Jan 2025500600015500
1 Jan 202560060009800
1 Jan 202510063004200
1 Jan 202520063007800
1 Jan 202560063003600

Showing the first 12 of 432 rows.

Measures: [Total Budget]

CostCenter 6 rows, 3 columns
CostCenterIDCostCenterDivision
100AdministrationAdministration
200ProductionOperations
300SalesSales
400MarketingSales
500ITAdministration
600WarehouseOperations
Account 7 rows, 4 columns
AccountIDAccountAccountTypeAccountGroup
4000RevenueIncomeRevenue
5000MaterialsExpenseMaterials
6000Salaries and WagesExpensePersonnel
6300RentExpenseOperating
6500TravelExpenseOperating
6800AdvertisingExpenseOperating
6900Other ExpensesExpenseOperating
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.

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
EntryIDDateCostCenterIDAccountIDAmount
123 Jan 2025300400088400
222 Jan 20253004000132600
312 Jan 2025200500036176
44 Jan 202560050005253.5
521 Jan 2025100600013276.2
630 Jan 202510060009613.8
716 Jan 2025200600049220
820 Jan 2025300600025440
929 Jan 2025400600012875
1029 Jan 2025500600017205
1110 Jan 202560060005045.04
1214 Jan 202560060004656.96

Showing the first 12 of 535 rows.

Measures: [Total Actual]

Budget 432 rows, 4 columns
DateCostCenterIDAccountIDAmount
1 Jan 20253004000221000
1 Jan 2025200500032300
1 Jan 202560050005530
1 Jan 2025100600021000
1 Jan 2025200600046000
1 Jan 2025300600024000
1 Jan 2025400600012500
1 Jan 2025500600015500
1 Jan 202560060009800
1 Jan 202510063004200
1 Jan 202520063007800
1 Jan 202560063003600

Showing the first 12 of 432 rows.

Measures: [Total Budget]

CostCenter 6 rows, 3 columns
CostCenterIDCostCenterDivision
100AdministrationAdministration
200ProductionOperations
300SalesSales
400MarketingSales
500ITAdministration
600WarehouseOperations
Account 7 rows, 4 columns
AccountIDAccountAccountTypeAccountGroup
4000RevenueIncomeRevenue
5000MaterialsExpenseMaterials
6000Salaries and WagesExpensePersonnel
6300RentExpenseOperating
6500TravelExpenseOperating
6800AdvertisingExpenseOperating
6900Other ExpensesExpenseOperating
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.

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%.

Done: all six cases

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

Go to the course view

Back to case 5 or the course overview.

Write to us

Choose language

Select your preferred language