DAX calculations — quiz
8 questions covering this module. Measures, filter context, CALCULATE, logical functions and time intelligence.
You want a percent of the total the user has currently selected via slicers. Use:
- ALL
- ALLSELECTED
- REMOVEFILTERS
- KEEPFILTERS
Answer: ALLSELECTED — ALLSELECTED clears the visual filter but keeps slicer and page filters — percent of visible total.
By default, a CALCULATE filter argument on a column:
- Adds to existing filters
- Replaces existing filters on that column
- Is ignored if a slicer exists
- Only works in calculated columns
Answer: Replaces existing filters on that column — Replacement is the default; wrap in KEEPFILTERS to intersect with the existing context instead.
Prior-year measures return blank for recent months. Most likely cause?
- Wrong DAX function
- The Date table does not cover complete years
- Too many relationships
- DirectQuery mode
Answer: The Date table does not cover complete years — Time intelligence needs a contiguous date table spanning full years, or edge periods break.
Which anchors a rolling 12-month window correctly inside a matrix?
- TODAY()
- MAX('Date'[Date])
- NOW()
- FIRSTDATE(Sales[Date])
Answer: MAX('Date'[Date]) — MAX of the date column respects the current row context, so historical rows compute correctly.
RANKX returns 1 for every product. Most likely fix?
- Change to DESC
- Pass ALL(Product[Name]) as the table argument
- Use TOPN instead
- Add a variable
Answer: Pass ALL(Product[Name]) as the table argument — Without ALL, ranking happens within each row's own filter context, so everything ranks first.
Why prefer DIVIDE over the / operator?
- It is faster
- It returns blank instead of erroring on divide by zero
- It handles text
- It respects slicers
Answer: It returns blank instead of erroring on divide by zero — DIVIDE has built-in divide-by-zero handling and an optional alternate result.
A percent-of-total shows 100% on every row. Cause?
- Wrong aggregation
- The denominator is filtered like the numerator — needs ALL
- Missing relationship
- Wrong data type
Answer: The denominator is filtered like the numerator — needs ALL — ALL or ALLSELECTED removes the filter from the denominator.
The difference between ALL and ALLSELECTED:
- None
- ALLSELECTED respects slicer selections; ALL ignores them
- ALL is faster
- ALLSELECTED works only on dates
Answer: ALLSELECTED respects slicer selections; ALL ignores them — ALLSELECTED usually matches what people mean by "of total".