Calculation groups, as a concept
A calculation group applies the same calculations (current, year to date, last year) to any measure, picked from a column in the report. In Power BI you build it in the model; the idea is a measure that switches on the selected item.
This lesson has a small table, Calculation, with one column Item: Current, YTD and Last year. It has no relationships. SELECTEDVALUE(Calculation[Item]) tells the measure which row it is in.
Your task
Complete Time Calc so that the YTD row shows the year-to-date Sales Amount and the Last year row the Sales Amount of the same period last year.
About this exercise
You practise one measure, many calculations with SWITCH, SELECTEDVALUE, TOTALYTD and SAMEPERIODLASTYEAR. 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, Time Calc, fills a Power BI-style matrix grouped by Calculation[Item] 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
Time Calc =
SWITCH(SELECTEDVALUE(Calculation[Item]),
"Current", [Sales Amount],
"YTD", ,
"Last year",
)The result to build
Slicer: Year is 2025
| Quarter | |||||
|---|---|---|---|---|---|
| Item | Q1 | Q2 | Q3 | Q4 | Total |
| Current | 34,747.45 | 25,115.10 | 29,587.65 | 40,286.10 | 129,736.30 |
| Last year | 24,861.05 | 38,624.30 | 34,912.80 | 29,260.00 | 127,658.15 |
| YTD | 34,747.45 | 59,862.55 | 89,450.20 | 129,736.30 | 129,736.30 |
| Total | |||||
Last updated 10 November 2026
Opening the exercise…