70-466 · Question #34
You are developing a SQL Server Analysis Services (SSAS) tabular project. A column named City must be added to the table named Customer. The column will be used in the definition of a hierarchy. The C
The correct answer is B. City:=RELATED (Geography[City]). The DAX RELATED function retrieves a single scalar value from a related table by traversing a many-to-one relationship, making it the correct choice for a calculated column that pulls data across a table relationship.
Question
Exhibit
Options
- ACity:=RELATEDTABLE (Geography)
- BCity:=RELATED (Geography[City])
- CCity:=Geography[City]
- DCity:=Geography![City]
- ECity:=RELATED (Geography[City])
- FCity:=RELATEDTABLE (Geography)
How the community answered
(27 responses)- B70% (19)
- C4% (1)
- D4% (1)
- E7% (2)
- F15% (4)
Why each option
The DAX RELATED function retrieves a single scalar value from a related table by traversing a many-to-one relationship, making it the correct choice for a calculated column that pulls data across a table relationship.
RELATEDTABLE returns an entire table object of related rows rather than a single scalar value, so it cannot be used directly as a calculated column expression that produces one city name per row.
RELATED(Geography[City]) traverses the existing many-to-one relationship from the Customer table to the Geography table and returns the City value for each corresponding row. This is the standard DAX pattern for creating a calculated column that brings in a scalar value from a related table, and the resulting column can then be used in a hierarchy definition.
The syntax Geography[City] without the RELATED function is not valid inside a calculated column on a different table and will not traverse the relationship to retrieve values.
Geography![City] uses an exclamation mark which is not valid DAX syntax; DAX uses bracket notation with the table name and no special operator between the table and column reference.
This choice is syntactically identical to option B and represents the same correct formula; B is designated as the answer in the exam key.
RELATEDTABLE returns a table of related rows rather than a scalar value, making it unsuitable for populating a single City value per row in a calculated column.
Concept tested: DAX RELATED function for calculated columns across relationships
Source: https://learn.microsoft.com/en-us/dax/related-function-dax
Topics
Community Discussion
No community discussion yet for this question.
