Power BI 778 DAX Formulas and Calculations 2 — Questions and Answers
Question 1: What does the RELATED function do in DAX?
- Creates a new relationship between tables
- Returns a value from a related table along the many-to-one side (Correct answer)
- Filters related rows from another table
- Joins two tables on a common key
Correct answer: Returns a value from a related table along the many-to-one side
RELATED retrieves a value from a column in a related table, traversing the relationship from the many side to the one side.
Question 2: What is the purpose of the DIVIDE function in DAX?
- Divides two numbers and returns an error if denominator is zero
- Divides two numbers safely, returning an alternate result if denominator is zero (Correct answer)
- Rounds a division result to two decimal places
- Converts a fraction to a percentage
Correct answer: Divides two numbers safely, returning an alternate result if denominator is zero
DIVIDE safely handles division by zero by returning an optional alternate result instead of throwing an error.
Question 3: Which DAX function returns the number of distinct values in a column?
- COUNT
- DISTINCTCOUNT (Correct answer)
- COUNTUNIQUE
- COUNTDISTINCT
Correct answer: DISTINCTCOUNT
DISTINCTCOUNT counts the number of unique, non-blank values in a column.
Question 4: What does the EARLIER function do in DAX?
- Returns a value from the previous row in a table
- References an outer row context in a nested row context iteration (Correct answer)
- Calculates values from the prior year
- Returns the earliest date in a column
Correct answer: References an outer row context in a nested row context iteration
EARLIER accesses the value of a column in an outer row context when two nested row iterations are active.
Question 5: Which DAX function returns a table with duplicate rows removed?
- FILTER
- VALUES
- DISTINCT (Correct answer)
- UNIQUE
Correct answer: DISTINCT
DISTINCT returns a one-column table containing all unique values from the specified column, excluding duplicates.
Question 6: What is evaluation context in DAX?
- The database where DAX queries run
- The set of filters and row iteration state that determines how a DAX expression is evaluated (Correct answer)
- The order in which DAX functions execute
- The visual where a measure is displayed
Correct answer: The set of filters and row iteration state that determines how a DAX expression is evaluated
Evaluation context in DAX refers to the combination of filter context and row context that controls how expressions are computed.
What does the RELATED function do in DAX?