Case 1: sales KPIs on the dashboard
The sales dashboard starts with three questions: how many customers does each rep serve, how big is an order on average, and who leads on sales?
In short: DISTINCTCOUNT(Orders[CustomerID]) counts distinct customers, DIVIDE([Total Sales], COUNTROWS(Orders)) gives the average order value. Show sales per rep as a bar chart with a slicer on the year.
Task 1: distinct customers per rep
Task For 2026 the head of sales wants to know how many different customers each rep served, not how many orders. Create the measure "Customer Count": the number of distinct customers in Orders.
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.
A customer with ten orders is one customer, so the measure counts distinct values instead of rows, as in the lesson on measures. Look at the total row: it shows 16 customers, while the rows add up to 23. Some customers were served by two reps in 2026, for example when a colleague from the same region stepped in.
Task 2: average order value
Task Create the measure "Avg Order Value": sales divided by the number of orders. Use DIVIDE.
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.
Every row in Orders is exactly one order, so COUNTROWS counts the orders. DIVIDE protects against dividing by zero when a region has no order in a period. AVERAGE(Orders[Amount]) calculates the same here, but the task asks for DIVIDE so you practice the pattern for ratios.
Task 3: sales per rep as a bar chart
Task For the sales dashboard: build a bar chart with SalesRep[Name] on the Y-axis and [Total Sales] on the X-axis, with a slicer on Date[Year] set to 2026.
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.
The lesson on creating visuals shows how to build visuals and slicers. On the finished dashboard the KPIs from tasks 1 and 2 usually sit as cards above the chart.
Common mistakes
COUNTROWS instead of DISTINCTCOUNT
COUNTROWS(Orders) counts orders, not customers. For Tom Wolf that gives 24 instead of 5.
COUNT on the customer ID
COUNT(Orders[CustomerID]) counts every non-blank value, so again every order.
In real Power BI
- Always count customers in the fact table. COUNTROWS(Customer) counts every customer in the master data, including those without an order in the period, as long as the relationship does not pass the filter from Orders to Customer.
- Measures like these suit the cards at the top of a dashboard: one number that recalculates with every slicer.
Check your result
- Task 1: Tom Wolf has five distinct customers in 2026, Emma Clarke and Sam Kerr three each.
- Task 2: An order brings 5,674.09 on average in the North, 3,926.50 in the South and 4,843.77 across all regions.
- Task 3: Sam Kerr is at the top with 133,720, Mia Lang at the bottom with 50,500.
Back to the course overview.