O'Reilly logo

Microsoft Tabular Modeling Cookbook by Paul te Braak

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using projection to combine data from different tables

The evaluation of an entire table (as shown in the previous recipe, Retrieving data from a single table) excludes the wider concept of projection, because the example returns all the columns from a single table. More often than not, we wish to return only a subset of columns (or perhaps even derived columns) from one or more tables. Unlike SQL, which allows projection in its syntax, DAX has no succinct projection equivalent.

Consider the following SQL statement, which selects column_a from table_a and column_b from table_b.

Select table_a.column_a, table_b.column_b From …

Using DAX, we cannot specify a projection in the same manner (as follows):

Evaluate('table_a'[column_a], 'table_b'[column_b]) ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required