70-467 · Question #137
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…
The correct answer is A. =RELATED(Geography[City]). In SSAS Tabular, a calculated column definition begins with '=' (not ':=' which denotes a measure). The RELATED() function is the correct DAX function for retrieving a scalar value from a related table when a relationship exists between the current table and the target table…
Question
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 City column exists in the Geography table that is related to the Customer table. You need to add the City column to the Customer table. How should you write the calculation?
Options
- A=RELATED(Geography[City])
- BCity:= LOOKUPVALUE(Geography[City],Geography[GeographyKey],[GeographyKey])
- CCity:=VALUES(Geography[City])
- D=VALUES(Geography[City])
- E=RELATED(Geography.City)
- FCity:= LOCKUP(Geography[City],Geography[GeographyKey],[GeographyKey])
How the community answered
(15 responses)- A73% (11)
- B13% (2)
- D7% (1)
- F7% (1)
Explanation
In SSAS Tabular, a calculated column definition begins with '=' (not ':=' which denotes a measure). The RELATED() function is the correct DAX function for retrieving a scalar value from a related table when a relationship exists between the current table and the target table. Since a relationship already exists between Customer and Geography, =RELATED(Geography[City]) is the proper syntax - it follows the table traversal and returns the matching City value for each row in Customer. Option B and C/F use ':=' (measure syntax) which is wrong for a calculated column. Option D uses VALUES() which returns a table, not a scalar, making it unsuitable for a column definition. Option E uses dot notation (Geography.City) which is not valid DAX syntax - DAX requires the bracket notation Table[Column]. LOOKUPVALUE (B) is used when no relationship exists, which is not the case here.
Topics
Community Discussion
No community discussion yet for this question.