Streak 0 daysPoints 0

Lesson33/59
Cumulative sales within a year

Year to date with TOTALYTD

New functionsTOTALYTD
StatusNot started

TOTALYTD(expression, Date[Date]) evaluates the expression from 1 January to the last date visible in the cell. In a Q3 row that is January to September; in the year row, the whole year.

It is shorthand for CALCULATE(expression, DATESYTD(Date[Date])), the next lesson’s form. The date column must be the date column of the date table.

Your task

Write Sales YTD: the Sales Amount from the start of the year up to the end of the cell’s period.

*1*1*1*1SALEST1 · 420 ROWSSalesKeyNUMOrder DateDATEShip DateDATEProductKeyNUMCustomerKeyNUMQuantityNUMUnit PriceNUMPRODUCTT2 · 8 ROWSProductKeyNUMProductTEXTCategoryTEXTColorTEXTList PriceNUMStandard CostNUMCUSTOMERT3 · 10 ROWSCustomerKeyNUMCustomerTEXTCountryTEXTSegmentTEXTDATET4 · 731 ROWSDateDATEYearNUMQuarterTEXTMonthTEXTMonth NumberNUMNOTES1Filters flow from 1 to *, alongthe arrow: Product filters Sales.2Select a column or a measureto insert it at the cursor.3Measures in this model:[Sales Amount]Key columnFact tableSALES MODEL · STAR SCHEMASHEET 1 OF 1

About this exercise

You practise cumulative sales within a year with TOTALYTD. The exercise runs on a small bike-shop model with a Sales fact table and Product, Customer and Date dimensions, the same star schema in every lesson.

Your measure, Sales YTD, fills a Power BI-style matrix grouped by Date[Year] and Date[Quarter]. As in a real report, each cell evaluates the measure in its own filter context, and the subtotals and the grand total are evaluated again in theirs rather than added up. When you check your answer, every cell is compared with the expected value, wrong cells are marked, and the hint is about the mistake you made.

Measures that already exist in the model: Sales Amount. Reference them in square brackets, for example [Sales Amount].

Where you start

Sales YTD =

The result to build

Expected result for Sales YTD
Year › QuarterSales YTD
2024127,658.15
Q124,861.05
Q263,485.35
Q398,398.15
Q4127,658.15
2025129,736.30
Q134,747.45
Q259,862.55
Q389,450.20
Q4129,736.30
Total129,736.30

Last updated 10 November 2026

Opening the exercise…