Streak 0 daysPoints 0

Lesson24/59
Totals that respect slicers

Share of the visible total with ALLSELECTED

New functionsALLSELECTED, DIVIDE
StatusNot started

Reports have slicers. This matrix is sliced to Bikes and Clothing, and a share should be of what the reader sees, not of every sale including accessories.

ALLSELECTED() clears the filters the matrix itself adds (its rows and columns) but keeps the slicers. ALL() or REMOVEFILTERS() clear the slicers too, and the shares stop adding up to 100%.

Your task

Write Share of Visible: the cell’s Sales Amount divided by the matrix’s grand total, respecting the category slicer.

*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 totals that respect slicers with ALLSELECTED and DIVIDE. 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, Share of Visible, fills a Power BI-style matrix grouped by Customer[Country] and Date[Year]. 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

Share of Visible =

The result to build

Slicer: Category is Bikes, Clothing

Expected result for Share of Visible
Year
Country20242025Total
France12.2%8.9%21.1%
Germany14.6%20.7%35.3%
Netherlands8.6%11.1%19.8%
United Kingdom14.0%9.8%23.8%
Total49.4%50.6%100.0%

Last updated 10 November 2026

Opening the exercise…