Case 6: territory report with a role
The dashboard goes to the territory managers. Each should see only their team, the title should name the region, and every rep's share should refer to total sales.
In short: the role [Region] = "South" on the SalesRep table filters everything related to SalesRep. The title comes from "Sales " & SELECTEDVALUE(SalesRep[Region], "all regions"), the share from DIVIDE([Total Sales], CALCULATE([Total Sales], ALL(SalesRep))).
Task 1: the role for the South
Task The South territory manager should only see their team's sales in the published dashboard. Write the table filter DAX expression of the role for the SalesRep table: only the South region.
Orders 221 rows, 5 columns
| OrderID | Date | CustomerID | RepID | Amount |
|---|---|---|---|---|
| 1001 | 4 Jan 2025 | 105 | 3 | 2850 |
| 1002 | 16 Jan 2025 | 101 | 1 | 8730 |
| 1003 | 19 Jan 2025 | 105 | 4 | 4650 |
| 1004 | 1 Feb 2025 | 103 | 2 | 5210 |
| 1005 | 11 Feb 2025 | 109 | 5 | 11440 |
| 1006 | 11 Feb 2025 | 111 | 6 | 2000 |
| 1007 | 11 Feb 2025 | 113 | 2 | 3850 |
| 1008 | 12 Feb 2025 | 103 | 2 | 5670 |
| 1009 | 13 Feb 2025 | 104 | 2 | 7380 |
| 1010 | 13 Feb 2025 | 109 | 5 | 8250 |
| 1011 | 16 Feb 2025 | 101 | 1 | 7650 |
| 1012 | 21 Feb 2025 | 101 | 2 | 6750 |
Showing the first 12 of 221 rows.
Measures: [Total Sales]
Customer 16 rows, 3 columns
| CustomerID | Customer | Industry |
|---|---|---|
| 101 | Berg Engineering Ltd | Manufacturing |
| 102 | Northlight Trading Co | Retail |
| 103 | Harbor Logistics Inc | Services |
| 104 | Crane Electric plc | Manufacturing |
| 105 | Sunfield Markets LLC | Retail |
| 106 | Alpine Tools Ltd | Manufacturing |
| 107 | Riverside Consulting LLC | Services |
| 108 | Lakeside Print Co | Services |
| 109 | Rhine Steel Inc | Manufacturing |
| 110 | West End Fashion Ltd | Retail |
| 111 | Valley Wine Merchants LLC | Retail |
| 112 | Midland Services Ltd | Services |
Showing the first 12 of 16 rows.
SalesRep 6 rows, 3 columns
| RepID | Name | Region |
|---|---|---|
| 1 | Emma Clarke | North |
| 2 | Tom Wolf | North |
| 3 | Ravi Patel | South |
| 4 | Lucy Evans | South |
| 5 | Sam Kerr | West |
| 6 | Mia Lang | West |
Target 144 rows, 3 columns
| Date | RepID | TargetAmount |
|---|---|---|
| 1 Jan 2025 | 1 | 7500 |
| 1 Feb 2025 | 1 | 7500 |
| 1 Mar 2025 | 1 | 7500 |
| 1 Apr 2025 | 1 | 7500 |
| 1 May 2025 | 1 | 9000 |
| 1 Jun 2025 | 1 | 9500 |
| 1 Jul 2025 | 1 | 9500 |
| 1 Aug 2025 | 1 | 7500 |
| 1 Sep 2025 | 1 | 7500 |
| 1 Oct 2025 | 1 | 9000 |
| 1 Nov 2025 | 1 | 9500 |
| 1 Dec 2025 | 1 | 9000 |
Showing the first 12 of 144 rows.
Measures: [Total Target]
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. More in the lesson on publishing and sharing.
Task 2: the title
Task The dashboard title should name the selected region. Create the measure "Report Title": "Sales " followed by the region, or "all regions" when none or several are selected.
Orders 221 rows, 5 columns
| OrderID | Date | CustomerID | RepID | Amount |
|---|---|---|---|---|
| 1001 | 4 Jan 2025 | 105 | 3 | 2850 |
| 1002 | 16 Jan 2025 | 101 | 1 | 8730 |
| 1003 | 19 Jan 2025 | 105 | 4 | 4650 |
| 1004 | 1 Feb 2025 | 103 | 2 | 5210 |
| 1005 | 11 Feb 2025 | 109 | 5 | 11440 |
| 1006 | 11 Feb 2025 | 111 | 6 | 2000 |
| 1007 | 11 Feb 2025 | 113 | 2 | 3850 |
| 1008 | 12 Feb 2025 | 103 | 2 | 5670 |
| 1009 | 13 Feb 2025 | 104 | 2 | 7380 |
| 1010 | 13 Feb 2025 | 109 | 5 | 8250 |
| 1011 | 16 Feb 2025 | 101 | 1 | 7650 |
| 1012 | 21 Feb 2025 | 101 | 2 | 6750 |
Showing the first 12 of 221 rows.
Measures: [Total Sales]
Customer 16 rows, 3 columns
| CustomerID | Customer | Industry |
|---|---|---|
| 101 | Berg Engineering Ltd | Manufacturing |
| 102 | Northlight Trading Co | Retail |
| 103 | Harbor Logistics Inc | Services |
| 104 | Crane Electric plc | Manufacturing |
| 105 | Sunfield Markets LLC | Retail |
| 106 | Alpine Tools Ltd | Manufacturing |
| 107 | Riverside Consulting LLC | Services |
| 108 | Lakeside Print Co | Services |
| 109 | Rhine Steel Inc | Manufacturing |
| 110 | West End Fashion Ltd | Retail |
| 111 | Valley Wine Merchants LLC | Retail |
| 112 | Midland Services Ltd | Services |
Showing the first 12 of 16 rows.
SalesRep 6 rows, 3 columns
| RepID | Name | Region |
|---|---|---|
| 1 | Emma Clarke | North |
| 2 | Tom Wolf | North |
| 3 | Ravi Patel | South |
| 4 | Lucy Evans | South |
| 5 | Sam Kerr | West |
| 6 | Mia Lang | West |
Target 144 rows, 3 columns
| Date | RepID | TargetAmount |
|---|---|---|
| 1 Jan 2025 | 1 | 7500 |
| 1 Feb 2025 | 1 | 7500 |
| 1 Mar 2025 | 1 | 7500 |
| 1 Apr 2025 | 1 | 7500 |
| 1 May 2025 | 1 | 9000 |
| 1 Jun 2025 | 1 | 9500 |
| 1 Jul 2025 | 1 | 9500 |
| 1 Aug 2025 | 1 | 7500 |
| 1 Sep 2025 | 1 | 7500 |
| 1 Oct 2025 | 1 | 9000 |
| 1 Nov 2025 | 1 | 9500 |
| 1 Dec 2025 | 1 | 9000 |
Showing the first 12 of 144 rows.
Measures: [Total Target]
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.
With the role only one region is ever in the filter, so the title reads "Sales South". Without a role and without a selection, the alternate value applies.
Task 3: every rep's share
Task How much does each rep contribute to total 2026 sales? Create the measure "Sales Share": [Total Sales] of the row divided by [Total Sales] of all reps.
Orders 221 rows, 5 columns
| OrderID | Date | CustomerID | RepID | Amount |
|---|---|---|---|---|
| 1001 | 4 Jan 2025 | 105 | 3 | 2850 |
| 1002 | 16 Jan 2025 | 101 | 1 | 8730 |
| 1003 | 19 Jan 2025 | 105 | 4 | 4650 |
| 1004 | 1 Feb 2025 | 103 | 2 | 5210 |
| 1005 | 11 Feb 2025 | 109 | 5 | 11440 |
| 1006 | 11 Feb 2025 | 111 | 6 | 2000 |
| 1007 | 11 Feb 2025 | 113 | 2 | 3850 |
| 1008 | 12 Feb 2025 | 103 | 2 | 5670 |
| 1009 | 13 Feb 2025 | 104 | 2 | 7380 |
| 1010 | 13 Feb 2025 | 109 | 5 | 8250 |
| 1011 | 16 Feb 2025 | 101 | 1 | 7650 |
| 1012 | 21 Feb 2025 | 101 | 2 | 6750 |
Showing the first 12 of 221 rows.
Measures: [Total Sales]
Customer 16 rows, 3 columns
| CustomerID | Customer | Industry |
|---|---|---|
| 101 | Berg Engineering Ltd | Manufacturing |
| 102 | Northlight Trading Co | Retail |
| 103 | Harbor Logistics Inc | Services |
| 104 | Crane Electric plc | Manufacturing |
| 105 | Sunfield Markets LLC | Retail |
| 106 | Alpine Tools Ltd | Manufacturing |
| 107 | Riverside Consulting LLC | Services |
| 108 | Lakeside Print Co | Services |
| 109 | Rhine Steel Inc | Manufacturing |
| 110 | West End Fashion Ltd | Retail |
| 111 | Valley Wine Merchants LLC | Retail |
| 112 | Midland Services Ltd | Services |
Showing the first 12 of 16 rows.
SalesRep 6 rows, 3 columns
| RepID | Name | Region |
|---|---|---|
| 1 | Emma Clarke | North |
| 2 | Tom Wolf | North |
| 3 | Ravi Patel | South |
| 4 | Lucy Evans | South |
| 5 | Sam Kerr | West |
| 6 | Mia Lang | West |
Target 144 rows, 3 columns
| Date | RepID | TargetAmount |
|---|---|---|
| 1 Jan 2025 | 1 | 7500 |
| 1 Feb 2025 | 1 | 7500 |
| 1 Mar 2025 | 1 | 7500 |
| 1 Apr 2025 | 1 | 7500 |
| 1 May 2025 | 1 | 9000 |
| 1 Jun 2025 | 1 | 9500 |
| 1 Jul 2025 | 1 | 9500 |
| 1 Aug 2025 | 1 | 7500 |
| 1 Sep 2025 | 1 | 7500 |
| 1 Oct 2025 | 1 | 9000 |
| 1 Nov 2025 | 1 | 9500 |
| 1 Dec 2025 | 1 | 9000 |
Showing the first 12 of 144 rows.
Measures: [Total Target]
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(SalesRep) only removes the rep filter, as in the lesson on percent of total.
Common mistakes
Region name misspelled
"Sout" instead of "South" matches no row. The role then sees no data at all, and the matrix stays empty.
Role on the Customer table
Customers have no region in the model; the region belongs to the rep. The rule therefore goes on SalesRep.
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. For the South territory manager the denominator from task 3 is therefore the South's sales, not the whole company's.
Check your result
- Task 1: With the role the 2026 matrix shows Manufacturing 74,880, Retail 57,520 and Services 24,660, together 157,060.
- Task 2: The rows read "Sales North", "Sales South" and "Sales West", the total row "Sales all regions".
- Task 3: Sam Kerr contributes 22.6% of 2026 sales, Mia Lang 8.5%.
Back to case 5 or the course overview.