Power BI 778 DAX Formulas and Calculations 1 — Questions and Answers
Question 1: What does the DAX function CALCULATE do?
- Sums values in a column
- Evaluates an expression in a modified filter context (Correct answer)
- Counts rows in a table
- Returns the first value in a column
Correct answer: Evaluates an expression in a modified filter context
CALCULATE evaluates a DAX expression after applying the specified filter modifications to the current filter context.
Question 2: Which DAX function returns the total of all values in a column, ignoring any filters?
- SUM
- SUMX
- CALCULATE(SUM(), ALL()) (Correct answer)
- TOTALSUM
Correct answer: CALCULATE(SUM(), ALL())
Wrapping SUM with CALCULATE and ALL() removes all filters, returning the grand total regardless of current context.
Question 3: What is the difference between SUM and SUMX in DAX?
- SUM works on columns; SUMX iterates a table row by row (Correct answer)
- SUM is faster than SUMX
- SUMX only works with text columns
- SUM supports multiple columns; SUMX supports one
Correct answer: SUM works on columns; SUMX iterates a table row by row
SUM aggregates a single column directly, while SUMX iterates each row of a table and evaluates an expression per row.
Question 4: Which DAX function counts the number of rows in a table?
- COUNT
- COUNTROWS (Correct answer)
- COUNTA
- COUNTBLANK
Correct answer: COUNTROWS
COUNTROWS returns the number of rows in a specified table or table expression.
Question 5: What does the ALL() function do when used inside CALCULATE?
- Applies all existing filters
- Removes all filters from the specified table or columns (Correct answer)
- Returns all values from a column as a list
- Adds new filters to the context
Correct answer: Removes all filters from the specified table or columns
ALL() removes filters from the specified table or columns, allowing calculations to ignore slicers and report filters.
Question 6: Which DAX time intelligence function calculates year-to-date totals?
- DATESMTD
- DATESQTD
- TOTALYTD (Correct answer)
- SAMEPERIODLASTYEAR
Correct answer: TOTALYTD
TOTALYTD evaluates an expression from the beginning of the year up to the last date in the current filter context.
What does the DAX function CALCULATE do?