

The simplest table expression is one that specifies the name of the table, enclosed in single quotes. The table expression defines the results of your query.

The clause begins with the evaluate keyword, followed by a table expression, enclosed in parenthesis.

When using DAX to retrieve tabular data, your entire statement is founded on the evaluate clause. However, you can write DAX queries directly in the MDX window without taking any other steps. You have to use an MDX query window because SSMS currently does not support a DAX-specific query window. To query data in an SSAS tabular database from within SSMS, you must first connect to the SSAS instance that contains the database and then open an MDX query window. For these examples, we use the AdventureWorks Tabular Model SQL 2012 database, available as a SQL Server Data Tools tabular project from the AdventureWorks CodePlex site.
#HOW TO QUERY DATA FROM TABLE OF ADVENTUREWORKS2012 DATABASE HOW TO#
This article explains how to get started writing DAX queries within SSMS and provides numerous examples that demonstrate each concept. But there might be times when you want to use DAX to access data directly from a tabular database, either by issuing queries in SSMS or by creating them in other client applications. As a result, if you plan to support tabular databases, you should have at least a basic understanding of how to use DAX to access data in those databases.īecause DAX has its roots in PowerPivot, much of what has been written about the language has focused on how to create expressions that define measures and calculated columns. In addition, some client applications, such as Power View, can issue DAX queries only. However, you cannot use MDX if the database is configured to run in DirectQuery mode. You can use either DAX or MDX to query data in an SSAS tabular database. When Microsoft added support for the tabular model in SSAS 2012, they included support for both DAX and Multidimensional Expressions (MDX), the language traditionally used to access SSAS multidimensional data. In fact, DAX is often considered an extension to the formula language used in Excel. This article continues that discussion by demonstrating how to use the Data Analysis Expressions (DAX) language to retrieve data from your tabular database.ĭAX has a rather unique history in that it’s a formula language with its roots in PowerPivot, an in-memory data exploration tool that brought the tabular model to Excel. In my last article, “ Getting Started with the SSAS Tabular Model,” I introduced you to the SQL Server Analysis Services (SSAS) tabular database and how to access its components in SQL Server Management Studio (SSMS). Using DAX to retrieve tabular data - Simple Talk
