Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Microsoft Tabular Modeling Cookbook

You're reading from   Microsoft Tabular Modeling Cookbook No prior knowledgeof tabular modeling is needed to benefit from this brilliant cookbook. This is the total guide to developing and managing analytical models using the Business Intelligence Semantic Models technology.

Arrow left icon
Product type Paperback
Published in Dec 2013
Publisher Packt
ISBN-13 9781782170884
Length 320 pages
Edition 1st Edition
Arrow right icon
Author (1):
Arrow left icon
Paul te Braak Paul te Braak
Author Profile Icon Paul te Braak
Paul te Braak
Arrow right icon
View More author details
Toc

Table of Contents (13) Chapters Close

Preface 1. Getting Started with Excel FREE CHAPTER 2. Importing Data 3. Advanced Browsing Features 4. Time Calculations and Date Functions 5. Applied Modeling 6. Programmatic Access via Excel 7. Enterprise Design and Features 8. Enterprise Management 9. Querying the Tabular Model with DAX 10. Visualizing Data with Power View A. Installing PowerPivot and Sample Databases Index

Restricting data with filters and where conditions


In the Using projection to combine data from different tables recipe, we stated that there is no WHERE clause in DAX. If this type of restriction is to be applied to a result set, it must be defined by a query, and this is the focus of this recipe. Here, we seek to answer the question:

Which customers had sales in 2008 and what was their sales value (for that year)?

Getting ready

The model used in this recipe is the sales data that has been used in this chapter (see the workbook Model.xlsx, which is available from online resources at http://www.packtpub.com).

How to do it…

This recipe examines two queries. Firstly, listing customers and their sales value in 2008, and secondly, listing customers that had sales in 2008 with their sales value.

  1. Create a new query to show the 2008 sales values of customers. The query is as follows:

    define measure 'Resellers'[Sales] = calculate('Reseller Sales'[USD Gross Sales], 'Dates'[Year]=2008)
    
    evaluate(
      addcolumns...
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