nerdexam
Microsoft

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.

Build a tabular data model

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?

Exhibit

70-466 question #34 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)
  • B
    70% (19)
  • C
    4% (1)
  • D
    4% (1)
  • E
    7% (2)
  • F
    15% (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.

ACity:=RELATEDTABLE (Geography)

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.

BCity:=RELATED (Geography[City])Correct

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.

CCity:=Geography[City]

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.

DCity:=Geography![City]

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.

ECity:=RELATED (Geography[City])

This choice is syntactically identical to option B and represents the same correct formula; B is designated as the answer in the exam key.

FCity:=RELATEDTABLE (Geography)

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

#DAX#RELATED function#calculated columns#table relationships

Community Discussion

No community discussion yet for this question.

Full 70-466 Practice