70-466 · Question #36
You are developing a SQL Server PowerPivot workbook that sources data from a SQL Azure database. The PowerPivot model includes a single table named FactSales that consists of four columns named Year,
The correct answer is B. =Sales] / [ALLSELECTED(FactSales)]. The Sales % measure must use ALLSELECTED so the denominator reflects only the rows visible under current external filters (slicers), making the Grand Total equal 100% within the visible data set.
Question
Exhibit
Options
- A=Sales] / CALCULATE([Sales])
- B=Sales] / [ALLSELECTED(FactSales)]
- C=Sales] / CALCULATE([Sales], VALUES(FactSales[Year]), VALUES(FactSales[Country]))
- D=Sales] / [SALES] / CALCULATE([Sales], ALLLEXCEPT(FactSales, FactSales[Year]))
How the community answered
(23 responses)- A17% (4)
- B70% (16)
- C9% (2)
- D4% (1)
Why each option
The Sales % measure must use ALLSELECTED so the denominator reflects only the rows visible under current external filters (slicers), making the Grand Total equal 100% within the visible data set.
CALCULATE([Sales]) with no filter arguments evaluates Sales in the current row context unchanged, so the expression reduces to [Sales]/[Sales] which always equals 1, not a meaningful percentage.
ALLSELECTED(FactSales) removes the inner PivotTable row/column filters while preserving any external filter context such as slicer selections, so the denominator equals the total of all currently visible Sales values. This means each cell shows its proportion of the visible total, and the Grand Total row correctly sums to 100%. The original ALL(FactSales) ignored external filters entirely, causing the percentage to be computed against all data regardless of what was filtered.
Supplying only VALUES(FactSales[Year]) and VALUES(FactSales[Country]) ignores the Product column filter, producing an incomplete denominator that does not generalize across all PivotTable filter combinations.
ALLEXCEPT(FactSales, FactSales[Year]) preserves Year filters in the denominator, so the ratio is computed within each Year rather than across all visible rows, and the Grand Total will not equal 100%.
Concept tested: DAX ALLSELECTED for percentage-of-visible-total calculations
Source: https://learn.microsoft.com/en-us/dax/allselected-function-dax
Topics
Community Discussion
No community discussion yet for this question.
