Case 4: sales growth and year-to-date
Two numbers count in the sales meeting: where do we stand since January, and are we growing over the prior year? You calculate both as measures.
In short: TOTALYTD([Total Sales], 'Date'[Date]) returns sales since the start of the year. Growth is DIVIDE([Total Sales] - [Sales Prior Year], [Sales Prior Year]), with the prior year from SAMEPERIODLASTYEAR.
Task 1: sales year-to-date
Task The monthly sales report shows sales since the start of the year. Create the measure "Sales YTD": [Total Sales] from 1 January to the end of the month in the row.
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.
The lesson on time intelligence explains the time functions. Sales were weak in May 2026; the year-to-date value only rises a little there but never drops, which keeps the line readable.
Task 2: growth over the prior year
Task Create the measure "Growth %": how much sales grew compared with the prior year, so (sales minus sales prior year) divided by sales prior year, using 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], [Sales Prior Year]
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 measure [Sales Prior Year] already exists, built with CALCULATE([Total Sales], SAMEPERIODLASTYEAR('Date'[Date])). You build the same comparison for products in the year-over-year project of the main course.
Common mistakes
Date column from Orders
TOTALYTD([Total Sales], Orders[Date]) does not accumulate but shows the monthly sales in every row. The exercise then points to the date table.
Growth divided by the current year
The base is the prior year. Dividing by [Total Sales] gives 22.2% instead of 28.5% for the North.
In real Power BI
- If the year is not over yet, compare year-to-date with the prior year's year-to-date, not with the whole prior year.
- A line chart with Sales YTD for both years shows at a glance from which month the new year is ahead.
Check your result
- Task 1: Sales year-to-date are 274,920 in June and 590,940 in December.
- Task 2: The North grows by 28.5%, the South by 21.4%, the West by 17.9%, all regions together by 23.1%.
Back to case 3 or the course overview.