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

Creating the model

An Excel workbook can only contain one tabular model and that one model contains tables of data (which may or may not be related). The first step to create a model is to import data into it. There are many techniques to do this—some techniques have advantages over others but for now, let's only consider the fact that we want to load data that exists in an Excel worksheet into the model.

Tip

The installation instructions for PowerPivot in Excel 2010 are covered in the Appendix, Installing PowerPivot and Sample Databases, of this book.

Getting ready

Open the Excel workbook named SalesBook which is available from the Packt Publishing website to examine the worksheets within the book. Each sheet contains a dataset for Products, Subcategories, Categories, Customers, Dates, and Sales.

How to do it…

This recipe looks at importing data into the PowerPivot model through linked tables. These are very convenient to use when the data is stored in Excel. Additionally, once the data has been imported into PowerPivot, it retains a connection to the Excel table. This means that, when the data is changed in Excel, it can also be changed in the PowerPivot model.

  1. Let's start by importing the product list. Select the Product List sheet and select cell A1.
  2. Then, on the PowerPivot tab, click on the Create Linked Table button.

    Tip

    Excel will automatically highlight the data range.

    How to do it…
  3. A small window will open confirming the data range with a checkbox for table headers. Select the checkbox and press OK.
  4. The PowerPivot window will open and the data from the Product List sheet will be imported. Note that the table appears as a tab which is similar to Excel and is called Table1. Also, note that the PowerPivot window is a separate window than the Excel workbook, so that we can return to Excel.
    How to do it…
  5. Repeat this process for all the remaining datasets except Customers.

How it works…

When a linked table is created in PowerPivot, Excel creates a named range in the Excel workbook. This is then linked to the PowerPivot model (note that there is a small chain symbol before each of the tables). Also, note that the tables in Excel are formatted with alternate blue coloring. The named ranges can be viewed in Excel by clicking on the Name Manager button on the Formulas tab.

How it works…

There's more…

A table (table range) is actually an Excel feature that PowerPivot utilizes. A table can be defined in Excel, given a meaningful name and then imported into PowerPivot, so that the name of the table in PowerPivot is the same as the named range in Excel.

Ensure that the Customers sheet is selected in Excel and also any cell in the Customers data is selected. In the Home tab, click on the Format as Table button, and choose a table style; the style chosen in the following screenshot is a relevant one:

There's more…

Note that the data is now formatted with alternating colors (based on the selected style). Return to the Name Manager window and double-click the table that relates to the Customers worksheet. A new window will open allowing you to edit the name, replace the name Table6 with Customers, and click on OK. The Table6 name is replaced by Customers in the Name Manager window.

There's more…

Now, create a linked table in the same manner as we did before and note that the name of the table imported into PowerPivot is Customers.

Tip

If you want to select an entire table in Excel, simply choose the table name from the Name Box drop-down list in the formula bar in the upper-left corner. This is shown in the following screenshot:

There's more…
You have been reading a chapter from
Microsoft Tabular Modeling Cookbook
Published in: Dec 2013
Publisher: Packt
ISBN-13: 9781782170884
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