Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Expert Cube Development with SSAS Multidimensional Models

You're reading from   Expert Cube Development with SSAS Multidimensional Models For Analysis Service cube designers this is the hands-on tutorial that will take your expertise to a whole new level. Written by a team of Microsoft SSAS experts, it digs deep to optimize your Business Intelligence capabilities.

Arrow left icon
Product type Paperback
Published in Feb 2014
Publisher Packt
ISBN-13 9781849689908
Length 402 pages
Edition Edition
Arrow right icon
Toc

Table of Contents (19) Chapters Close

Expert Cube Development with SSAS Multidimensional Models
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
1. Designing the Data Warehouse for Analysis Services FREE CHAPTER 2. Building Basic Dimensions and Cubes 3. Designing More Complex Dimensions 4. Measures and Measure Groups 5. Handling Transactional-Level Data 6. Adding Calculations to the Cube 7. Adding Currency Conversion 8. Query Performance Tuning 9. Securing the Cube 10. Going in Production 11. Monitoring Cube Performance and Usage DAX Query Support Index

Running DAX queries against a Multidimensional model


Rather than using Power View, in some cases, you may want to be able to run your own DAX queries against a Multidimensional model rather than using MDX. Scenarios where this might make sense include when you are building a SQL Server Reporting Services report and you find that a DAX query runs much faster than an equivalent MDX query, or you find that it's easier to write a calculation needed for your report in DAX rather than in MDX (although it is possible to declare DAX calculations in MDX queries—see http://tinyurl.com/DAXinMDX).

Executing DAX queries

DAX queries can be run from an MDX query window in SQL Server Management Studio, just like an MDX query. However, the problem with doing this is that you will see MDX metadata in the Metadata pane rather than DAX metadata, and this makes composing your query difficult. As an alternative, you can use DAX Studio, a free, community-developed Excel add-in that can be downloaded from http://tinyurl.com/DAXStudio. DAX Studio makes it easy to write DAX queries and displays the result of your query either in a grid or in an Excel worksheet. If you are using SQL Server Reporting Services, you have to use the DMX query editor to run your queries, though again you will not see any DAX metadata. Details on how to do this can be found in the following blog post: http://tinyurl.com/DAXSSRS. In all of these cases, when you are setting up your connection to Analysis Services Multidimensional, you must remember to specify the Cube connection string property, just as you do with Power View connections.

DAX queries and attributes

It is out of the scope of this book to provide a full description of the DAX query language; if you would like to learn more about it, a series of blog posts on the subject can be found here: http://tinyurl.com/DAXQueries. There is, however, one extra thing to take into account when using DAX queries on Analysis Services Multidimensional that is not relevant to DAX queries on Analysis Services Tabular: when you query a table representing a dimension, there are restrictions on the columns that you can use in your query. For example, the following DAX query returns all of the columns on the table representing the Date dimension in the Adventure Works database:

EVALUATE 'DATE' 

Here are the results of the query:

Each of the columns returned by this query represents a column used in either the KeyColumns, the NameColumn, the ValueColumn, or a member property of an attribute on the dimension. However, if you only wish to return some of the columns and not all of them, you will need to remember that if you select one column, you will also need to select all of the columns built from the KeyColumns property from the same attribute for the query to run.

So, for example, trying to run the following DAX query will result in an error because only one of the columns that represent the Fiscal Year hierarchy on the Date dimension is included:

EVALUATE SUMMARIZE('DATE', 'DATE'[Fiscal Year]) 

However, the following query will run successfully because it includes the column 'Date'[Fiscal Year.Key0]:

EVALUATE 
SUMMARIZE('DATE', 
'DATE'[Fiscal Year.Key0],
'DATE'[Fiscal Year])

Here are the results of this query; all of the distinct key and name values used in the Fiscal Year attribute of the Date dimension:

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image