Professional Documents
Culture Documents
10778A
Implementing Data Models and Reports
with Microsoft® SQL Server® 2012
Companion Content
2 Implementing Data Models and Reports with Microsoft® SQL Server® 2012
Information in this document, including URL and other Internet Web site references, is subject to change
without notice. Unless otherwise noted, the example companies, organizations, products, domain names,
e-mail addresses, logos, people, places, and events depicted herein are fictitious, and no association with
any real company, organization, product, domain name, e-mail address, logo, person, place or event is
intended or should be inferred. Complying with all applicable copyright laws is the responsibility of the
user. Without limiting the rights under copyright, no part of this document may be reproduced, stored in
or introduced into a retrieval system, or transmitted in any form or by any means (electronic, mechanical,
photocopying, recording, or otherwise), or for any purpose, without the express written permission of
Microsoft Corporation.
Microsoft may have patents, patent applications, trademarks, copyrights, or other intellectual property
rights covering subject matter in this document. Except as expressly provided in any written license
agreement from Microsoft, the furnishing of this document does not give you any license to these
patents, trademarks, copyrights, or other intellectual property.
The names of manufacturers, products, or URLs are provided for informational purposes only and
Microsoft makes no representations and warranties, either expressed, implied, or statutory, regarding
these manufacturers or the use of the products with any Microsoft technologies. The inclusion of a
manufacturer or product does not imply endorsement of Microsoft of the manufacturer or product. Links
may be provided to third party sites. Such sites are not under the control of Microsoft and Microsoft is not
responsible for the contents of any linked site or any link contained in a linked site, or any changes or
updates to such sites. Microsoft is not responsible for webcasting or any other form of transmission
received from any linked site. Microsoft is providing these links to you only as a convenience, and the
inclusion of any link does not imply endorsement of Microsoft of the site or the products contained
therein.
© 2011 Microsoft Corporation. All rights reserved.
Microsoft, and Windows are either registered trademarks or trademarks of Microsoft Corporation in the
United States and/or other countries.
All other trademarks are property of their respective owners.
Released: 05/2012
Implementing Data Models and Reports with Microsoft® SQL Server® 2012 3
4 Implementing Data Models and Reports with Microsoft® SQL Server® 2012
Implementing Data Models and Reports with Microsoft® SQL Server® 2012 5
6 Implementing Data Models and Reports with Microsoft® SQL Server® 2012
Implementing Data Models and Reports with Microsoft® SQL Server® 2012 7
Module 1
Introduction to Business Intelligence and Data Modeling
Contents:
Lesson 1: Introduction to Business Intelligence 8
Lesson 1
Introduction to Business Intelligence
Contents:
Additional Reading 9
Implementing Data Models and Reports with Microsoft® SQL Server® 2012 9
Additional Reading
Business Intelligence Scenarios
• For more information about building and populating data warehouses, you should attend Course
10777A, Implementing a Data Warehouse with Microsoft® SQL Server® 2012.
10 Implementing Data Models and Reports with Microsoft® SQL Server® 2012
Lesson 2
The Microsoft Business Intelligence Platform
Contents:
Additional Reading 11
Implementing Data Models and Reports with Microsoft® SQL Server® 2012 11
Additional Reading
Microsoft Business Intelligence Technologies
• For more information about multidimensional databases in SQL Server 2012 Analysis Services, see
Module 5 of this course, Creating Multidimensional Databases. For more information about tabular
databases in SQL Server 2012 Analysis Services, see Module 12 of this course, Implementing an
Analysis Services Tabular Data Model. For more information about PowerPivot technologies, see
Module 10 of this course, Implementing a Tabular Data Model with Microsoft PowerPivot.
• For more information about Reporting Services in SQL Server 2012, see Module 2 of this course,
Implementing Reports with SQL Server Reporting Services. For more information about Power View,
see Module 13 of this course, Creating Data Visualizations with Power View.
• For more information about SQL Server Integration Services, Data Quality Services, and Master Data
Services, you should attend Course 10777A, Implementing a Data Warehouse with Microsoft® SQL
Server® 2012.
• For more information about PowerPivot for Excel and PowerPivot for SharePoint, see Module 10 of
this course, Implementing a Tabular Data Model with Microsoft PowerPivot.
• For more information about data mining and the Data Mining Add-ins for Excel and Data Mining in
SQL Server 2012 Analysis Services, see Module 14 of this course, Performing Predictive Analysis with
Data Mining.
• Deployment Checklist: Reporting Services, Power View, and PowerPivot for SharePoint
Answer: Answers will vary depending upon individuals and their experiences.
Answer: Answers will vary depending upon individuals and their experiences.
Implementing Data Models and Reports with Microsoft® SQL Server® 2012 13
Module 2
Implementing Reports with SQL Server Reporting Services
Contents:
Lesson 1: Introduction to Reporting Services 14
Lesson 1
Introduction to Reporting Services
Contents:
Additional Reading 15
Implementing Data Models and Reports with Microsoft® SQL Server® 2012 15
Additional Reading
SQL Azure Reporting Services
• Windows Azure Business Analytics
16 Implementing Data Models and Reports with Microsoft® SQL Server® 2012
Lesson 2
Creating a Report with Report Designer
Contents:
Detailed Demonstration Steps 17
Implementing Data Models and Reports with Microsoft® SQL Server® 2012 17
2. Start SQL Server Data Tools, and create a new project using the Report Server Project Wizard
template. Name the project ReportsDemo1 and save in the D:\107778A\Demofiles\Mod02 folder.
4. In the Select the Data Source page, create a new data source named AdventureWorksDW that
uses Windows authentication to connect to the AdventureWorksDW database on the localhost
instance of SQL Server. Do not select the Make this a shared data source checkbox, and click Next.
5. On the Design the Query page, click Query Builder, and in the Query Designer window, perform
the following steps and click OK. Then click Next.
EnglishCountryRegionName: Country
StateProvincename: State
ResellerName: Reseller
6. On the Select the Report Type page, ensure that Tabular is selected, and then click Next.
7. On the Design the Table page, add all fields to the Details section. Then click Next.
8. On the Choose the Table Style page, preview each of the built-in styles, and then select Generic and
click Next.
9. On the Choose the Deployment Location page, review the default selections and then click Next.
10. On the Completing the Wizard page, change the report name to Reseller Sales and click Finish.
2. In the Report Data pane, expand Data Sources and note that the AdventureWorksDW data source
you defined in the wizard has been created. Then expand Datasets and note that a dataset named
Dataset1 has been created from the query you defined in the wizard.
3. Right-click Dataset1 and click Dataset Properties. Then change the name to ResellerSales and click
OK.
4. Click the Preview tab and view the report with its default formatting. Then click the Design tab.
5. In the report body, click the text box at the top left containing the report title (Reseller Sales), and
then use the formatting buttons on the toolbar to make the title bold with a size of 14pt.
6. Click the tablix data region so that the gray row and column headers appear, and click the gray box
where the row and column headers intersect to select the data region. Then drag the multidirectional
arrow handle to move the data region down to make room for a larger title.
7. Click the title textbox and resize it so all of the text is visible.
8. In the tablix data region, click the top-left cell (which contains the Country column title) and drag to
the bottom-right cell (which contains the [SalesAmount] field) to select all cells in the data region.
Then click the Align Left button on the toolbar.
9. Click outside of the tablix data region to de-select it, and then select the first row of the tablix data
region (which contains the column titles) and on the toolbar, click the Bold button. Then click the
Background Color button and set the background to Light Gray.
10. Right-click the cell containing the [OrderDate] field and click Textbox Properties. Then in the Text
Box Properties dialog box, on the Number tab, select the Date category and the 31-Jan-00 type
and click OK.
11. Click the cell containing the [SalesAmount] field and press F4. Then in the Properties pane, set the
Format property to $###,##0.00.
12. Click the tablix region so that the gray row and column headers appear, and then click and drag the
border between the column headings to widen the columns so that the data they contain fits on a
single line. You may need to switch back and forth between Design and Preview tabs to determine
appropriate column widths.
14. Click the Export button, and then click Excel. When prompted, save the report as Reseller Sales.xlsx in
the D:\107778A\Demofles\Mod02 folder.
15. Close SQL Server Data Tools, and then open the Reseller Sales.xlsx Excel workbook in the
D:\107778A\Demofles\Mod02 folder and view the exported report.
16. Close Excel.
Implementing Data Models and Reports with Microsoft® SQL Server® 2012 19
Lesson 3
Grouping and Aggregating Data in a Report
Contents:
Detailed Demonstration Steps 20
20 Implementing Data Models and Reports with Microsoft® SQL Server® 2012
3. In the Groupings pane, in the Row Groups section, in the table1_Details_Group drop-down list, point
to Add Group and click Parent Group. Then in the Tablix Group dialog box, in the Group By list
click [Country], select Add group header, and click OK.
4. Note that the report now contains two Country columns – one for the group you just created, and
one for the original Country field, which is no longer required. Right-click the gray column header for
the original Country field (the second column) and click Delete Columns to remove it.
5. In the Report Data pane, expand Datasets, and drag the State field from the ResellerSales dataset
and drop it between the Country and table1_Details_Group groups in the Grouping pane. Note that
this adds a group for the State field without a group header in addition to the original State field.
Then, right-click the gray column header for the original State field (the third column) and click
Delete Columns to remove it.
6. Right-click the [State] field in the second column, point to Insert Row, and click Inside Group –
Above. This creates a header row for the group.
7. Right-click the [City] field in the third column, point to Add Group, and under Row Group, click
Parent Group. Then in the Tablix Group dialog box, in the Group By list click [City], select Add
group header, and click OK. Then, right-click the gray column header for the original City field (now
the fourth column) and click Delete Columns to remove it.
8. Right-click the [City] field in the third column, point to Add Group, and click Child Group. Then in
the Tablix Group dialog box, in the Group By list click [Reseller], select Add group header, and
click OK. Then, right-click the gray column header for the original Reseller field (the fifth column)
and click Delete Columns to remove it.
9. In the Groupings pane, in the table1_Details_Group drop-down list, click Group Properties. Then
on the Sorting tab, click Add and in the Sort by column, click [OrderDate]. Then click OK.
10. Preview the report, and switch back to the Design tab to widen the new columns as required. When
you are satisfied with the column widths, preview the report and note that the data is now grouped
and sorted.
2. In the Groupings pane, on the State drop-down list, point to Add Total and click Before. Note that
this adds an expression to calculate the sum of the [SalesAmount] field to the first row in the table
(in which the [Country] field is displayed in the first column).
3. Repeat the previous step for the City, Reseller, and table1_Details_Group groups, and note that the
Sales Amount column now contains subtotals for each grouping with a grand total at the bottom.
4. When you added the totals, Report Designer automatically created a Total label for each row. Delete
all of these Total labels other than the one on the bottom row of the table.
5. Right-click the cell immediately above the [Sales Order Number] field in the Sales Order Number
column, and click Expression. Then in the Expression dialog box, enter the following expression and
click OK.
=CountDistinct(Fields!SalesOrderNumber.Value)
6. Right-click the cell containing the expression you just created and click Copy, and then paste the cell
into each of the empty cells above it.
7. Preview the report, and note that the number of orders and sales total for each group is displayed.
2. In the Group Properties dialog box, on the Visibility tab, select the Hide option, select the Display
can be toggled by this report item checkbox, and in the drop-down list, select Reseller1. Then click
OK. Reseller1 is the textbox containing the name of the reseller for each Reseller group.
3. Repeat the previous two steps to hide the following groups and enable them to be toggled by the
specified report items:
2. Click the tablix data region so that the gray row and column headers appear, and click the gray box
where the row and column headers intersect to select the data region. Then in the Properties pane,
expand the PageBreak property group for the table1 tablix and set the BreakLocation property to
Start. This creates a page break at the start of the tablix data region.
3. In the Groupings pane, click the Country group. Then in the Properties pane, expand the Group and
PageBreak property groups for the Country tablix member and set the BreakLocation property to
Between. This creates a page break between each instance of the Country group.
4. With the Country group still selected, in the Properties pane, set the PageName property to the
following expression:
22 Implementing Data Models and Reports with Microsoft® SQL Server® 2012
=Fields!Country.Value
5. Preview the report and note that the first page contains only the report title.
6. Use the page navigation buttons to scroll through the report and verify that each country group
starts on a new page.
7. Click the Export button, and then click Excel. When prompted, save the report as Reseller Sales.xlsx in
the D:\107778A\Demofles\Mod02 folder – replacing the file if it already exists.
8. Close SQL Server Data Tools, and then open the Reseller Sales.xlsx Excel workbook in the
D:\107778A\Demofles\Mod02 folder and view the exported report, noting that it contains a title
worksheet and a worksheet for each country, in which users can expand or collapse the grouped data.
Then close Excel.
Implementing Data Models and Reports with Microsoft® SQL Server® 2012 23
Lesson 4
Showing Data Graphically
Contents:
Detailed Demonstration Steps 24
Additional Reading 25
24 Implementing Data Models and Reports with Microsoft® SQL Server® 2012
3. Click the tablix data region so that the gray row and column headers appear, and click the gray box
where the row and column headers intersect to select the data region. Then drag the multidirectional
arrow handle to move the data region down about 10 centimeters.
4. In the Toolbox, drag a Chart to the blank area you just created above the tablix data region. Then in
the Select Chart Type dialog box, in the Shape section select the third chart style (3-D Pie) and click
OK.
5. Move and resize the chart to fit the available space above the tablix data region.
2. In the Chart Data pane, in the Values section, add the SalesAmount field.
3. In the Chart Data pane, in the Category Groups section, add the Country field.
4. Click the Preview tab and verify that the chart displays sales by country.
2. Click a blank area on the report design surface, and then right-click the chart, point to Chart, and click
Chart Properties.
3. In the Chart Properties dialog box, in the Color palette drop-down list, select Bright pastel, and
click OK.
5. Click the Export button, and then click Excel. When prompted, save the report as Reseller Sales.xlsx in
the D:\107778A\Demofles\Mod02 folder – replacing the file if it already exists.
6. Close SQL Server Data Tools, and then open the Reseller Sales.xlsx Excel workbook in the
D:\107778A\Demofles\Mod02 folder and view the exported report, noting that the first worksheet
contains the chart. Then close Excel.
Implementing Data Models and Reports with Microsoft® SQL Server® 2012 25
Additional Reading
Working with Charts
• For more information about using charts in reports, see Charts (Report Builder 3.0 and SSRS) in SQL
Server Books Online.
Using Indicators
• For more information about using indicators in reports, see Indicators (Report Builder 3.0 and SSRS) in
SQL Server books Online.
Lesson 5
Filtering Reports By Using Parameters
Contents:
Detailed Demonstration Steps 27
Implementing Data Models and Reports with Microsoft® SQL Server® 2012 27
3. In the Report Data pane, expand Datasets and then right-click the ResellerSales dataset and click
Query.
4. In the Query Designer dialog box, add the following WHERE clause to the existing Transact-SQL
query, and then click OK.
5. Right-click the ResellerSales dataset and click Dataset Properties. Then in the Dataset Properties
dialog box, on the Parameters tab, note that a dataset property named @Year has been created,
and click OK.
6. In the Report Data pane, expand Parameters and note that a report parameter named Year has been
created.
2. In the Report Parameter Properties dialog box, on the General tab, in the data type drop-down list,
select Integer. Then click OK.
3. Click the Preview tab and note that the report is not rendered. Then, in the Year text box, type 2004
and click View Report. The report is then rendered with data for sales in 2004.
2. In the Dataset Properties dialog box, perform he follow steps and then click OK.
3. Repeat the previous two steps to create a dataset named MostRecentSalesYear that uses the
following Transact-SQL query.
4. In the Report Data pane, right-click the Year report parameter and click Parameter Properties.
5. In the Report Parameter Properties dialog box, on the Available Values tab, perform the following
steps:
6. On the Default Values tab, perform the following steps. Then click OK.
Lesson 6
Publishing and Viewing a Report
Contents:
Detailed Demonstration Steps 30
30 Implementing Data Models and Reports with Microsoft® SQL Server® 2012
3. In Solution Explorer, right-click the ReportDemo5 project and click Properties. Then set the
following properties and click OK:
• TargetDatasetFolder: http://mia-sqlbi/reports/demo/datasets
• TargetdataSourceFolder: http://mia-sqlbi/reports/demo/datasources
• TargetReportFolder: http://mia-sqlbi/reports/demo
• TargetReportPartFolder: http://mia-sqlbi/reports/demo/reportparts
• TargetServerURL: http://mia-sqlbi
2. Observe the deployment progress in the status bar and the Output pane.
2. Under Libraries, click Reports. Then in the Reports document library, click the demo folder.
3. Click the Reseller Sales report and note that it is rendered in the SharePoint interface.
4. In the Parameters pane, in the Year drop-down list, select 2003, and click Apply. The report is
rendered again with the data for sales in 2003.
5. In the Actions menu, point to Export, and click excel. When prompted, save the report as Reseller
Sales.xlsx in the D:\107778A\Demofles\Mod02 folder – replacing the file if it already exists.
Answer: You could use Report builder, but in most cases a professional report developer
should use Report Designer in SQL Server Data Tools.
Question: You need to create a report in which users can view a summary of sales totals for
each month of the year and drilldown into the individual sales for each month. How can you
achieve this?
Answer: You can create a group in the report based on the Month field, with an aggregate
total in the group header. You can then configure the Visibility properties of the details
group so that it is hidden by default and can be toggled by the textbox containing the
Month field in the Month group header row.
Question: You want to show a graphical representation of a company’s profit for the year
to-date compared to the target that was set at the beginning of the year. How can you
achieve this?
Answer: You could use a chart, but for this kind of single value visualization, a gauge is the
most appropriate choice.
32 Implementing Data Models and Reports with Microsoft® SQL Server® 2012
Module 3
Supporting Self Service Reporting
Contents:
Lesson 1: Introduction to Self Service Reporting 33
Lesson 1
Introduction to Self Service Reporting
Contents:
Detailed Demonstration Steps 34
34 Implementing Data Models and Reports with Microsoft® SQL Server® 2012
2. Start Internet Explorer and browse to the Reports document library in the SharePoint site at
http://mia-sqlbi.
3. In the ribbon, on the Documents tab, in the New Document drop-down list, click Report Builder
Report. If you are prompted to install Report Builder, click Run, and wait for Report Builder to be
downloaded. The application starts automatically after it has been downloaded.
4. In the Getting Started dialog box, ensure that New Report is selected and click Table or Matrix
Wizard.
5. On the Choose a dataset page, ensure Create a dataset is selected, and click Next.
6. On the Choose a connection to a data source page, click New, and in the Data Source Properties
dialog box, create a data source with the following settings and click OK. Then click Next.
• On the General tab, change the Name property to AdventureWorksDW, ensure that the
Microsoft SQL Server connection type is selected, and enter the following connection string.
• On the Credentials tab, ensure that the Use current Windows user. Kerberos delegation
might be required option is selected.
7. On the Design a query page, in the Database view pane, expand Tables, expand the
DimGeography, DimDate, DimCustomer, and FactInternetSales tables, and select the following
fields:
• DimDate.CalendarYear
• DimDate.MonthNumberOfYear
• DimDate.EnglishMonthName
• DimGeography.EnglishCountryRegionName
• DimCustomer.GeographyKey
• FactInternetSales.CustomerKey
• FactInternetSales.OrderDateKey
• FactInternetSales.SalesAmount
8. After you have selected the fields, click Run Query and note that no rows are returned. Then expand
the Relationships pane, review the relationships that have been automatically detected, and note
that the FactInternetSales table is joined to the DimDate table on three fields (OrderDateKey,
DueDateKey, and ShipDateKey).
Implementing Data Models and Reports with Microsoft® SQL Server® 2012 35
9. Click Edit as Text and modify the query to remove the AND clauses that join the FactInternetSales
table to the DimDate table on the DueDateKey and ShipDateKey columns and click the Run button
to verify that the query now returns data. Then click Next.
Note This step highlights the fact that some knowledge of query syntax may be required
to define a dataset for a report. In a self-service reporting scenario, some users may not
have this knowledge. Later in this module, the use of shared data sources and datasets to
overcome this problem is discussed.
10. On the Arrange fields page, drag and drop the fields to the following groups and then click Next.
• Row groups
EnglishCountryRegionName
• Column groups
CalendarYear
EnglishMonthName
• Values
SalesAmount
11. On the Choose the layout page, ensure that Show subtotals and grand totals and
Expand/collapse groups are all selected, and then click Next.
12. On the Choose a style page, in the Styles list, select Generic. Then click Finish.
13. In the Click to add title text box, type Sales Report. Then click Run to preview the report, and then
click Design and widen columns as necessary.
3. In Internet Explorer, in the Quick Launch area of the http://mia-sqlbi SharePoint site, under Libraries,
click Reports to refresh the view and note that Demo Sales Report has been published in the
Reports document library. Then click Demo Sales Report and view the report.
2. Click the cell containing the expression [Sum(SalesAmount)] directly beneath the
[EnglishMonthName] cell, and then hold the Shift key and click the [Sum(SalesAmount)] field at
the bottom right of the tablix data region to select all of the [Sum(SalesAmount)] cells. Then on the
toolbar, click the currency ($) format button.
3. In the Groupings pane, in the EnglishMonthName group drop-down list, click Group Properties.
Then on the Sorting tab, change the Sort by field to MonthNumberOfYear so that the months are
36 Implementing Data Models and Reports with Microsoft® SQL Server® 2012
sorted in calendar order, and click OK. Then, in the quick access toolbar, click Save. Then close Report
Builder.
4. In Internet Explorer, in the Reports document library, click Demo Sales Report to view the report
and note that your changes have been published to the report server. Then close Internet Explorer.
Implementing Data Models and Reports with Microsoft® SQL Server® 2012 37
Lesson 2
Shared Data Sources and Datasets
Contents:
Detailed Demonstration Steps 38
38 Implementing Data Models and Reports with Microsoft® SQL Server® 2012
2. Start Internet Explorer and browse to the Reports document library in the SharePoint site at
http://mia-sqlbi.
3. In the ribbon, on the Documents tab, in the New Document drop-down list, click Report Data
Source.
4. In the Data Source Properties page, configure a data source with the following settings and click
OK.
2. When Report Builder starts, in the Getting Started dialog box, select New Report and click Table or
Matrix Wizard.
3. On the Choose a dataset page, ensure Create a dataset is selected, and click Next.
4. On the Choose a connection to a data source page, click Browse and browse to the http://mia-
sqlbi/Reports folder. Then select the Demo Adventure Works DW.rsds shared data source you
created in the previous task and click Open. Then ensure that the Demo Adventure Works
DW.rsds data source is selected, and click Next.
5. On the Design a query page, in the Database view pane, expand Tables, expand the
DimCustomer, DimGeography, and FactInternetSales tables, and select the following fields:
• DimGeography.EnglishCountryRegionName
• DimCustomer.GeographyKey
• FactInternetSales.CustomerKey
• FactInternetSales.SalesAmount
6. Expand the Relationships pane, review the relationships that have been automatically detected. Then
click Next.
Implementing Data Models and Reports with Microsoft® SQL Server® 2012 39
7. On the Arrange fields page, drag and drop the fields to the following groups and then click Next.
• Row groups
EnglishCountryRegionName
• Values
SalesAmount
8. On the Choose the layout page, ensure that Show subtotals and grand totals is selected, and then
click Next.
9. On the Choose a style page, in the Styles list, select any style. Then click Finish.
10. In the Report data pane, expand Data Sources and then right-click the data source used by the
report and click Data Source Properties. Note that the data source is a reference to the Demo
Adventure Works DW.rsds shared data source you created earlier, and then click OK.
11. Format the report as necessary - for example, format the [Sum(SalesAmount)] fields as currency and
widen the columns.
12. Click Run to preview the report, and then close Report Builder without saving the report. Then close
Internet Explorer.
Note This demonstration requires that you have completed the previous demonstration in
this module. If you have not done so, you must create a shared data source named Demo
Adventure Works DW.rsds that connects to the AdventureWorksDW database in the
localhost instance of SQL Server.
2. Start Internet Explorer and browse to the Reports document library in the SharePoint site at
http://mia-sqlbi.
3. In the ribbon, on the Documents tab, in the New Document drop-down list, click Report Builder
Report.
4. When Report Builder starts, in the Getting Started dialog box, select New Dataset and select the
Demo Adventure Works DW.rsds data source you created in the previous demo. If Demo
Adventure Works DW.rsds is not listed, click Browse other data sources and browse to the
http://mia-sqlbi/Reports folder. Then select the Demo Adventure Works DW.rsds shared data
source and click Open. When you have selected the Demo Adventure Works DW.rsds data source,
click Create.
5. On the ribbon, in the Query Designer section, click Import. Then browse to the
D:\10778A\Demofiles\Mod03 folder, select Internet Sales.sql, and click Open.
40 Implementing Data Models and Reports with Microsoft® SQL Server® 2012
6. On the ribbon, click the Run button. When the query has completed, review the results, which show
Internet sales data.
7. In the quick access toolbar, click Save. Then in the Save As Dataset dialog box, browse to the
http://mia-sqlbi/Reports folder, in the Name box type Demo Internet Sales.rsd, and save the
dataset.
2. On the Choose a dataset page, select Choose an existing dataset in this report or a shared
dataset, click Browse and in the http://mia-sqlbi/Reports folder, click Demo Internet Sales.rsd and
click Open. Then click Next.
3. On the Arrange fields page, drag and drop the fields to the following groups and then click Next.
• Row groups
CalendarYear
Month
• Column groups
ProductCategory
• Values
SalesAmount
4. On the Choose the layout page, ensure that Show subtotals and grand totals, Blocked, subtotal
below, and Expand/collapse groups are all selected, and then click Next.
5. On the Choose a style page, in the Styles list, select any style. Then click Finish.
6. Format the report as necessary - for example, format the [Sum(SalesAmount)] fields as currency and
widen the columns.
7. In the Groupings pane, in the Month group drop-down list, click Group Properties. Then on the
Sorting tab, change the Sort by field to MonthNo so that the months are sorted in calendar order,
and click OK.
8. Click Run to preview the report, and then close Report Builder without saving the report. Then close
Internet Explorer.
Implementing Data Models and Reports with Microsoft® SQL Server® 2012 41
Lesson 3
Report Parts
Contents:
Detailed Demonstration Steps 42
42 Implementing Data Models and Reports with Microsoft® SQL Server® 2012
2. Start Internet Explorer and browse to the Reports document library in the SharePoint site at
http://mia-sqlbi.
3. In the ribbon, on the Documents tab, in the New Document drop-down list, click Report Builder
Report. If you are prompted, click Run, and wait for Report Builder to be downloaded. The
application starts automatically after it has been downloaded.
4. In the Getting Started dialog box, ensure that New Report is selected and click Chart Wizard.
5. On the Choose a dataset page, ensure Create a dataset is selected, and click Next.
6. On the Choose a connection to a data source page, click New, and in the Data Source Properties
dialog box, create a data source with the following settings and click OK. Then click Next.
• On the General tab, change the Name property to AdventureWorksDW, ensure that the
Microsoft SQL Server connection type is selected, and enter the following connection string.
• On the Credentials tab, ensure that the Use current Windows user. Kerberos delegation
might be required option is selected.
7. On the Design a query page, click Import and browse to the D:\10778A\Demofiles\Mod03 folder,
select SalesByYear.sql, and click Open. Then on the toolbar, click the Run button to verify that the
query returns sales volumes for years and product categories, and click Next.
8. On the Choose a chart type page, select Line, and click Next.
9. On the Arrange chart fields page, drag CalendarYear to the Categories list, drag ProductCategory
to the Series list, and drag SalesAmount to the Values list. Then click Next.
10. On the Choose a style page, select Generic, and then click Finish.
11. When the report has been created, click the Chart Title text box and then select the text and change
it to Sales Trend. Then resize the chart to make it bigger.
12. Click Run to preview the chart and then click Design to return to design view.
13. With the chart selected, on the View tab of the ribbon, select Properties. Then in the Properties
pane, change the Name property of the chart to DemoSalesTrendChart.
14. In the Report Data pane, expand Datasets, right-click DataSet1 and click Dataset Properties. Then
in the Dataset Properties dialog box, change the Name property to DemoSalesByYear and click
OK.
Implementing Data Models and Reports with Microsoft® SQL Server® 2012 43
15. Click the round button at the top left of the ribbon, and on the Report Builder menu, click Publish
Report Parts, and in the Choose Sharepoint Document Library dialog box, select the Reports
document library and click OK. Then on the Publish Report parts dialog box, click Review and
modify report parts before publishing.
16. In the Publish Report Parts dialog box, expand DemoSalesTrendChart and in the description box,
type Chart showing sales by category over time. Then click Publish, and when the Result message
shows that a report part was published successfully, click Close.
3. In the Report Part Gallery pane, in the search box type Sales and click the search button. Note that
the DemoSalesTrendChart report part you published in the previous task is listed in the results.
6. Click the Click to add title textbox and type Sales Report.
7. On the Home tab, click Run to preview the report and note that the report part is shown with the
chocolate color palette in this report.
8. In the quick access toolbar, click Save. Then in the Save As Report dialog box, browse to the
http://mia-sqlbi/Reports folder, in the Name box type Demo Sales Report – Line Chart.rdl, and click
Save.
2. Drag the DemoSalesTrendChart report part from the Report Parts Gallery pane to the body of the
report.
3. Right-click the chart title, point to Chart, and click Chart Properties. Then in the Chart properties
dialog box, in the Color palette drop-down list, select Sea green and click OK.
4. Click the round button at the top left of the ribbon, and on the Report Builder menu, click Publish
Report Parts, and in the Choose Sharepoint Document Library dialog box, select the Reports
document library and click OK. Then on the Publish Report parts dialog box, click Review and
modify report parts before publishing.
5. In the Publish Report Parts dialog box, expand DemoSalesTrendChart and ensure that the Publish
as a new copy of the report part checkbox is not selected. Then click Publish, and when the
Result message shows that a report part was published successfully, click Close.
6. Click the round button at the top left of the ribbon, and on the Report Builder menu, in the Recent
Documents list, click Demo Sales Report – Line Chart.rdl. Do not save the current report from
which you republished the report part.
44 Implementing Data Models and Reports with Microsoft® SQL Server® 2012
7. Wait for a few moments until the Updated Report Parts message appears under the ribbon. Then
click View Updates.
8. In the Update Report Parts dialog box, select the DemoSalesTrendChart report part and click
Update. Then click Close and note that the report has been updated with the new version of the
report part.
9. Save the report and close Report Builder and Internet Explorer.
Implementing Data Models and Reports with Microsoft® SQL Server® 2012 45
Answer: Create shared data sources that encapsulates the connection information for each
database that can be used as a source for reports.
Question: How can you simplify self-service reporting for business users who aren’t familiar
with query syntax?
Answer: Create shared datasets that retrieve commonly used data for reports.
Question: How can you create a standard gauge that multiple business users can include in
their reports?
Answer: Create the gauge in a report and then publish it as a report part.
46 Implementing Data Models and Reports with Microsoft® SQL Server® 2012
Module 4
Managing Report Execution and Delivery
Contents:
Lesson 1: Managing Report Security 47
Lesson 1
Managing Report Security
Contents:
Additional Reading 48
48 Implementing Data Models and Reports with Microsoft® SQL Server® 2012
Additional Reading
Managing Authentication
• Kerberos Documentation for Windows
Implementing Data Models and Reports with Microsoft® SQL Server® 2012 49
Lesson 2
Managing Report Execution
Contents:
Detailed Demonstration Steps 50
50 Implementing Data Models and Reports with Microsoft® SQL Server® 2012
3. Start Internet Explorer and browse to SharePoint site at http://mia-sqlbi, and in the Reports
document library, click Demo to view the contents of the Demo folder.
4. On the drop-down list for the AdventureWorksDW data source, click View Dependent Items and
note that the Monthly Sales Report report has a dependency on this data source. Then click Close.
5. On the drop-down list for the AdventureWorksDW data source, click Edit Data Source Definition,
and in the Credentials section of the configuration page, note that the data source is currently
configured to use the Windows authentication (Integrated) or SharePoint user option.
6. In the Credentials section, select the Stored credentials option and enter the following credentials:
• User Name: ADVENTUREWORKS\ServiceAcct
• Password: Pa$$w0rd
7. Select Use as Windows credentials and click Test Connection. Then when the connection has been
tested successfully, click OK.
2. In the Data Refresh Options section, select the Use cached data option, and then in the Cache
Options section, select On a custom schedule and click Configure.
3. In the Frequency section, select Day, in the Schedule section select all of the days and set the Start
time to 12:00 am, and click OK. Then click OK again to set the processing options and return to the
Reports document library.
4. Click Monthly Sales Report and note the execution date and time under the report heading.
5. At the top of the report page, click the demo link to return to return to the Demo folder, and then
click Monthly Sales Report again. Note that the execution date and time have not changed because
the report has been cached.
Implementing Data Models and Reports with Microsoft® SQL Server® 2012 51
Lesson 3
Subscriptions and Data Alerts
Contents:
Detailed Demonstration Steps 52
52 Implementing Data Models and Reports with Microsoft® SQL Server® 2012
Note This demonstration requires that you have completed the previous demonstration in
this module.
3. In the Delivery Extension drop-down list, select Windows File Share, and then enter the following
settings, and then click OK:
• File name: MonthlySalesReport
• Path: \\MIA-SQLBI\SharedReports
• Delivery Event: On a custom schedule. Click Configure and define a custom schedule that will
send the report daily, two minutes from the current time; and click OK. You can determine the
current system time by starting a command prompt window and entering the command time /T.
• Password: Pa$$w0rd
4. At the top of the report page, click the demo link to return to return to the Demo folder.
5. In the drop-down list for the Monthly Sales Report report, click Manage Subscriptions. Then view
the information about the Windows File Share subscription you created in the previous task.
6. Wait two minutes and then refresh the page. The Last Results column should indicate that
subscription has run. Then minimize Internet Explorer with the Manage Subscriptions page still open
7. View the contents of the D:\10778A\Demofiles\Mod04\SharedReports folder and verify that the
report has been created.
• Linked – a Boolean value that indicates whether the subscription email should include a link to
the report on the report server.
3. Click Execute to run the query. Then when it has completed, close SQL Server Management Studio.
4. Maximize Internet Explorer, and in the Manage Subscriptions page for the Monthly Sales Report
report, click Add data-Driven Subscription.
5. In the Description text box, type Weekly Sales Report. Then, in the Connection Type section, select
Shared data source, in the Data Source Link section, click the ellipsis (…) button, and in the Select
an Item dialog box, select the AdventureWorksDW data source and click OK.
6. In the Query section, type SELECT * FROM ReportSubscriptionsDemo and click Validate. When the
query is validated successfully, click Next.
7. In the Calendar Year section, ensure that Use report default value is selected, and click Next.
8. In the Delivery Type section, ensure that E-Mail is selected. Then set the following configuration
values and click Next.
• Comment: Specify a static value (enter The weekly sales report is attached)
11. In the Schedule section, select the current day and enter a time that is two minutes later than the
current time. You can determine the current system time by starting a command prompt window and
entering the commands and time /T. You can also use the command echo %date% to determine the
current day and date.
14. View the contents of the C:\inetpub\mailroot\Drop folder and note the email messages that have
been received by the local SMTP server.
15. Open the three most recent messages, and verify that the report has been sent in Excel, Word, and
embedded HTML formats.
Note This demonstration requires that you have completed the first demonstration in this
module.
3. In the New Data Alert – Monthly Sales Report dialog box, in the Report data name drop-down
list, select Tablix1.
4. Click Add rule and click Product Category, then in the drop-down list for the rule value, click Bikes.
This creates a rule that sends an alert of the report data includes any sales for the Bikes product
category.
5. Under Schedule settings, change Daily to Minute, and ensure that the alert is scheduled for every 1
minute(s).
6. In the Email settings section, change the Recipient(s) value to student@adventureworks.msft,
and then click Save.
7. Minimize Internet Explorer and view the contents of the C:\inetpub\mailroot\Drop folder. Then wait
for a minute and refresh the folder until a new e-mail message appears.
8. Double-click the new e-mail message to view the alert. Then close the e-mail message and the folder
window.
2. In the drop-down list for the Monthly Sales Report report, click Manage Data Alerts.
3. Note that the alert you created previously is listed and that the Last Run and Status columns provide
information about when the alert was last sent.
4. Right-click the alert, and on the shortcut menu that appears, click Delete.
Lesson 4
Troubleshooting Reporting Services
Contents:
Additional Reading 56
56 Implementing Data Models and Reports with Microsoft® SQL Server® 2012
Additional Reading
Reporting Services Logs
• For more information about execution logging, see Report Server Execution Log and the
ExecutionLog3 View in SQL Server Books Online.
• For a full list of counters provided by the MSRS 2011 Windows Service and MSRS 2011 Windows
Service SharePoint Mode performance objects, see Performance Counters for the MSRS 2011
Windows Service Performance Object in SQL Server Books Online.
• For a full list of counters provided by the ReportServer:Service and
ReportServerSharePoint:Service performance objects, see Performance Counters for the
ReportServer:Service Performance Object in SQL Server Books Online.
Implementing Data Models and Reports with Microsoft® SQL Server® 2012 57
Answer: Ensure that the Windows account used by the sales manager is a member of at
least the Visitors group in the SharePoint library.
Question: You want to reduce the time it takes to render a report that contains a lot of data.
How can you achieve this?
Answer: You could cache the report or the dataset is uses. Alternatively, you could schedule
the creation of snapshots from the report and have users view the snapshots instead of the
live report.
Answer: Create a subscription that delivers the report in Excel format to the SharePoint
document library.
58 Implementing Data Models and Reports with Microsoft® SQL Server® 2012
Module 5
Creating Multidimensional Databases
Contents:
Lesson 2: Creating Data Sources and Data Source Views 59
Lesson 2
Creating Data Sources and Data Source Views
Contents:
Detailed Demonstration Steps 60
60 Implementing Data Models and Reports with Microsoft® SQL Server® 2012
2. Click Start, click All Programs, click Microsoft SQL Server 2012, and then click SQL Server Data
Tools.
5. In the Select or enter a database name field, click AdventureWorksDW, and then click OK.
6. Click Next.
7. Click Use a Specific Windows user name and password, and enter the user name
ADVENTUREWORKS\Student and the password Pa$$w0rd. Then click Next.
8. In the Data source name field, type AdventureWorks Demo DS, and then click Finish.
2. On the Welcome to the Data Source View Wizard page, click Next.
3. Ensure that AdventureWorks Demo DS is selected, and then click Next.
5. Click Next.
6. In the Name field, type AdventureWorks Demo DSV, and then click Finish.
2. In Data Source Designer, navigate through the database diagram until you locate the
FactInternetSales table.
3. Click the table name of the FactInternetSales table and press F4.
5. Right-click the DimCustomer table, and then click New Named Calculation.
6. In the Column name field, type Full Name.
7. In the Expression field, type FirstName + ' ' + LastName, and then click OK.
8. On the File menu, click Save All. Then minimize SQL Server Data Tools. You will return to it in a later
demonstration.
62 Implementing Data Models and Reports with Microsoft® SQL Server® 2012
Lesson 3
Creating a Cube
Contents:
Detailed Demonstration Steps 63
Implementing Data Models and Reports with Microsoft® SQL Server® 2012 63
2. Maximize SQL Server Data Tools, which should be open with the Demo project loaded.
5. On the Select Creation Method page, ensure that Use existing tables is selected, and click Next.
6. On the Select Measure Group Tables page, click Suggest. Then note that the wizard identifies
Internet Sales as a measure group table, and click Next.
7. On the Select Measures page, clear the Internet Sales checkbox to clear all selections, and then
select the Total Product Cost and Sales Amount measures. Then click Next.
8. On the Select New Dimensions page, clear the parent Internet Sales checkbox, and click Next.
9. On the Completing the Wizard page, change the cube name to Demo Cube and click Finish. The
cube is created and opened in the cube designer.
3. In the Metadata pane, expand Measures and expand Internet Sales. The wizard has created the
measures you selected.
4. Drag the Sales Amount measure to the Drag levels or measures here to add to the query area.
The total sales amount for all Internet sales is shown.
5. In the Metadata pane, note that the wizard has created dimensions for the DimCustomer and
DimProduct tables. It has also determined that there are three relationships defined between the
Internet Sales table and the DimDate table, and so has a dimension for each related column (Due
Date, Order Date, and Ship Date).
6. Expand each of the dimensions and note the wizard has only created attributes for key columns. You
will need to modify the dimensions to add meaningful attributes for analysis.
7. Drag the Product Key attribute from the Dim Product dimension and drop it to the left of the Sales
Amount value in the grid. The browser now shows the aggregated sales amount totals for each
product key.
2. Right-click the Total Product Cost measure and click Rename. Then change the name of the
measure to Cost.
3. In the Dimensions pane, right-click Dim Customer and click Rename, and change the name of the
dimension to Customer. Then rename Dim Product to Product.
4. Right-click the Product dimension and click Edit Dimension. This opens the dimension designer for
the Dim Product dimension (the dimension is named Product in the Demo Cube cube, but still
named Dim Product in the database).
5. In the Data Source View pane, in the DimProduct table, drag the EnglishProductName field to the
Attributes pane.
6. In the Attributes pane, right-click English Product Name and click Rename. Then rename the
attribute to Product Name.
7. In Solution Explorer, right-click Demo and click Deploy. If prompted, enter the password Pa$$w0rd
for the ADVENTUREWORKS\Student user. Then wait for the deployment process to finish.
8. Click the Demo Cube.cube [Design] tab to return to the cube designer, and then in the cube
designer, click the Browser tab.
9. On the Browser tab, click the Reconnect button in the upper left. If the grid contains any data from
previous queries, right-click in the grid and click Clear Grid.
10. In the Metadata pane, expand Measures and Internet Sales, and drag Cost to the Drag levels or
measures here to add to the query area.
11. Expand the Product dimension, and then drag Product Name to the left of the Cost value. The total
cost associated with sales for each product is shown.
12. On the File menu, click Save All, and then minimize SQL Server Data Tools. You will use it again in a
later demonstration.
Implementing Data Models and Reports with Microsoft® SQL Server® 2012 65
Lesson 4
Overview of Cube Security
Contents:
Detailed Demonstration Steps 66
66 Implementing Data Models and Reports with Microsoft® SQL Server® 2012
2. Maximize SQL Server Data Tools, which should be open with the Demo project loaded.
3. In Solution Explorer, right-click Roles, and click New Role. Then in Solution Explorer, right-click the
Role.role icon that has been added, click Rename, and change the name to Restricted User.role.
when prompted to change the object name as well, click Yes.
4. In the role designer, on the General tab, note that by default this role has no database permissions.
5. On the Membership tab, note that this is where you can add Windows users and groups to the role.
6. On the Data Sources tab, note that by default the role has no access to any data sources.
7. On the Cubes tab, change the Access value for Demo Cube to Read. This allows the role to access
the cube and read its data.
8. On the Cell Data tab, note that this is where you can specify MDX statements that define cells in the
cube which you want to permit or deny this role to access.
9. On the Dimensions tab, note that the role has Read access to all dimensions in the database. Then in
the Select Dimension Set list at the top of the page, click Demo Cube cube dimensions and note
that these permissions are inherited by the dimensions in the Demo Cube cube.
10. On the Dimension Data tab, in the Dimension list, under Demo Cube, select Measures Dimension.
Then on the Basic tab, clear the checkbox for the Cost measure.
11. In the Dimension list, under Demo Cube, select Product, and on the Basic tab, in the Attribute
hierarchy list, select Product Name.
12. Select Deselect all members. Then scroll to the bottom of the list of product names and select only
the products that begin with the word Touring.
2. When deployment is complete, in Solution Explorer, double-click Demo Cube.cube to return to the
cube designer.
3. On the Browser tab, click the Reconnect button at the top left. If the grid contains any data from
previous queries, right-click in the grid and click Clear Grid.
4. In the Metadata pane, expand Measures and Internet Sales, and drag Sales Amount and Cost to
the Drag levels or measures here to add to the query area. Then expand the Product dimension
and drag Product Name to the left of the measure values. The browser shows cost and sales amount
for all products.
Implementing Data Models and Reports with Microsoft® SQL Server® 2012 67
5. In the top left area of the browser window, click the Change User button. Then, in the Security
Context – Demo Cube dialog box, select Roles, and in the drop-down list, select Restricted User
and click OK. Click OK again to return to the browser window.
6. Note that the grid has been cleared. Then, in the Metadata pane, expand Measures and Internet
Sales, and drag Sales Amount to the Drag levels or measures here to add to the query area. Note
that members of this role cannot access the Cost measure.
7. Expand the Product dimension and drag Product Name to the left of the measure values. The
browser shows sales amount for only the Touring products.
8. On the File menu, click Save All, and then close SQL Server Data Tools.
68 Implementing Data Models and Reports with Microsoft® SQL Server® 2012
Answer: Some of the name matching methods that are available when creating a data
source view include Same name as primary key, Same name as destination table name,
Destination table name + primary key name.
Question: How can you use the Cube Designer to configure a cube after it has been
created?
Answer: You can do this by using the Cube Structure tab, the Dimension Usage tab, or
other tabs of Cube Designer as needed.
Question: After creating a data source by using the Data Source Wizard, what tool would
you use to modify the data source?
Answer: You would use Data Source Designer to modify the data source.
Module 6
Working with Dimensions
Contents:
Lesson 1: Configuring Dimensions 70
Lesson 1
Configuring Dimensions
Contents:
Additional Reading 71
Implementing Data Models and Reports with Microsoft® SQL Server® 2012 71
Additional Reading
Dimension Types
• how to Add Account Intelligence to a Dimension
• Dimension Types
72 Implementing Data Models and Reports with Microsoft® SQL Server® 2012
Lesson 2
Defining Attribute Hierarchies
Contents:
Detailed Demonstration Steps 73
Additional Reading 74
Implementing Data Models and Reports with Microsoft® SQL Server® 2012 73
5. On the Select Creation Method page, select Use an existing table and click Next.
6. On the Specify Source Information page:
• Click Next.
7. On the Select Related Tables page, ensure that DimSalesTerriroty is selected and click Next.
8. On the Select Dimension Attributes page, click Next.
9. On the Completing the Wizard page, in the Name box, type Employee and click Finish.
3. In the Level Naming Template dialog box type Senior Management in the first blank cell.
4. Move down one cell and type Middle Management and move down another cell and type
Employee.
5. Click OK.
7. In Solution Explorer, right-click Adventure Works OLAP and click Deploy. If prompted, specify the
password Pa$$w0rd for the ADVENTUREWORKS\Student user.
8. When deployment has completed, click the Browser tab and expand the employees in the hierarchy.
Note that when you select an employee, the hierarchy level name is displayed at the top of the
browser area.
Additional Reading
Parent-Child Hierarchies
• Parent-Child Dimensions
Implementing Data Models and Reports with Microsoft® SQL Server® 2012 75
Answer: Dimensions relate to fact tables using the key column attribute. Other attributes are
used to add hierarchies and provide additional information.
Question: Aside from organizational charts, where else might you find parent-child
hierarchies?
Answer: There is no correct or incorrect answer. Typically if you can assign a fact to a non-
leaf member it needs to be a parent child.
Question: When might you want to use a secondary attribute for sorting data?
Answer: You might want to sort an employee by last name although the key column is
employeeid and the name column is a full name calculated column.
76 Implementing Data Models and Reports with Microsoft® SQL Server® 2012
Module 7
Working with Measures and Measure Groups
Contents:
Lesson 1: Working with Measures 77
Lesson 1
Working with Measures
Contents:
Additional Reading 78
78 Implementing Data Models and Reports with Microsoft® SQL Server® 2012
Additional Reading
Introducing Measures
• For more information about aggregation, see the Aggregation Functions topic later in this lesson.
Aggregation Functions
• Configure Measure Properties
Implementing Data Models and Reports with Microsoft® SQL Server® 2012 79
Lesson 2
Working with Measure Groups
Contents:
Detailed Demonstration Steps 80
Additional Reading 82
80 Implementing Data Models and Reports with Microsoft® SQL Server® 2012
3. In Solution Explorer, right-click Adventure Works OLAP and click Deploy. If prompted, specify the
user name ADVENTUREWORKS\Student and the password Pa$$w0rd.
4. In Solution Explorer, double-click Adventure Works Cube.cube, and on the Browser tab, expand
Measures and Internet Sales and drag the Sales Amount measure to the Drag levels or measures
here to add to the query area. Then expand the Geography dimension and drag Country-Region
to the left of the Sales Amount value.
Note that the values for each region are the same. The aggregation is incorrect.
5. In Solution Explorer, right-click Geography.dim, and then click View Designer. Note that this
dimension is based on the Geography table and has a Country-Region attribute.
6. In Solution Explorer, right-click Customer.dim, and then click View Designer. Note that this
dimension is based on the Customer table, which includes a GeographyKey attribute that relates it
to the Geography table.
7. Click the tab for the Adventure Works Cube.cube, and on the Cube Structure tab, in the Data
Source View pane, note that there is no direct relationship between the InternetSales fact table and
the Geography dimension table.
8. On the Dimension Usage tab, click the intersection of the Internet Sales measure group and the
Geography dimension, click the ellipses (…) button.
11. In the Reference dimension attribute list, select Geography Key, and in the Intermediate
dimension attribute list, select Geography Key.
13. In Solution Explorer, right-click Adventure Works OLAP and click Deploy. If prompted, specify the
user name ADVENTUREWORKS\Student and the password Pa$$w0rd.
14. Click the tab for the Adventure Works Cube.cube, and on the Browser tab, click the Reconnect
button. Then in the data grid area, click the Click to execute the query link.
Note that the values for each region are now correct.
Implementing Data Models and Reports with Microsoft® SQL Server® 2012 81
15. On the Dimension Usage tab, in the Dimensions list, right-click Geography, and then click
Rename.
16. Change the name of this cube dimension to Reseller Geography, and then press Enter to make this
name change take effect.
82 Implementing Data Models and Reports with Microsoft® SQL Server® 2012
Additional Reading
Partitions
• Remote Partitions
Implementing Data Models and Reports with Microsoft® SQL Server® 2012 83
Answer:
Additive: Sales Amount in a Sales measure group, which for example can be aggregated by
Sum across all dimensions.
Question: What are the two ways in which you can partition a measure group?
Question: How can you use aggregations to improve query response time?
Answer: Aggregations improve query response time by preparing the answers before the
questions are asked.
84 Implementing Data Models and Reports with Microsoft® SQL Server® 2012
Module 8
Introduction to MDX
Contents:
Lesson 1: MDX Fundamentals 85
Lesson 1
MDX Fundamentals
Contents:
Additional Reading 86
86 Implementing Data Models and Reports with Microsoft® SQL Server® 2012
Additional Reading
What Is MDX?
• For more information about the DAX language, see Module 11, “Introduction to Data Analysis
Expressions (DAX).”
Implementing Data Models and Reports with Microsoft® SQL Server® 2012 87
Lesson 2
Adding Calculations to a Cube
Contents:
Detailed Demonstration Steps 88
Additional Reading 89
88 Implementing Data Models and Reports with Microsoft® SQL Server® 2012
6. In the Name box, change the name of the new named set to [Accessories].
7. On the Metadata tab, in the Calculation Tools pane, expand Product, expand Product Category,
expand Members, and then expand All.
4. In the Measure Group pane, expand the Product dimension, and then add the Product Category
hierarchy to the left of Sales Amount.
5. In the Measure Group pane, in the Product Category dimension, drag Accessories onto <Select
dimension>. The data now shows only sales for accessories.
Additional Reading
Useful MDX Functions (Non-Family Functions)
• For more information about the DAX language, see Module 11, “Introduction to Data Analysis
Expressions (DAX).”
• Multidimensional Expressions (MDX) Reference
Lesson 3
Using MDX to Query a Cube
Contents:
Additional Reading 91
Implementing Data Models and Reports with Microsoft® SQL Server® 2012 91
Additional Reading
Using MDX in SQL Server Reporting Services
• For more information about Reporting Services, see Module 2, “Implementing Reports with SQL
Server Reporting Services,” Module 3, “Supporting Self-Service Reporting,” and Module 4, “Managing
Report Execution and Delivery.”
92 Implementing Data Models and Reports with Microsoft® SQL Server® 2012
Question: What are the three panes of the Calculations tab and what purpose does each
pane serve?Answer: You use the Script Organizer pane to create, organize, and select
calculations for editing; the Calculation Tools pane provides metadata, functions, and
templates with which to create calculations; the Calculation Expressions pane supports a
form view and a script view.
Question: How can you create named sets?Answer: By using the New Named Set
command on the Calculations tab of the Cube Designer.
Implementing Data Models and Reports with Microsoft® SQL Server® 2012 93
Module 9
Customizing Cube Functionality
Contents:
Lesson 1: Working with Key Performance Indicators 94
Lesson 1
Working with Key Performance Indicators
Contents:
Detailed Demonstration Steps 95
Implementing Data Models and Reports with Microsoft® SQL Server® 2012 95
3. In the Solution Explorer pane, right-click Adventure Works OLAP, and then click Deploy. If
prompted, specify the password Pa$$w0rd and click OK.
4. After deployment is complete, in Solution Explorer right-click Adventure Works Cube.cube, click
Open, and then click the KPIs tab.
6. In the Name box, type Reseller Revenue, and then in the Associated measure group list, click
Reseller Sales.
7. On the Metadata tab in the Calculation Tools pane, expand Measures, expand Reseller Sales, and
then drag the Sales Amount – Reseller Sales measure to the Value Expression box.
8. On the Metadata tab in the Calculation Tools pane, expand Measures, expand Sales Quota, and
then drag the Sales Amount Quota measure to the Goal Expression box.
9. Verify that Gauge is selected in the Status indicator list, and then type the following MDX expression
in the Status expression box (you can copy this from KPI Status Expression.txt in the demo folder):
Case
When
KpiValue("Reseller Revenue")/KpiGoal("Reseller Revenue")>=.95
Then 1
When
KpiValue("Reseller Revenue")/KpiGoal("Reseller Revenue")<.95
And
KpiValue("Reseller Revenue")/KpiGoal("Reseller Revenue")>=.5
Then 0
Else -1
End
10. Verify that Standard arrow is selected in the Trend indicator list, and then type the following
expression in the Trend expression box (you can copy this from KPI Trend Expression.txt in the
demo folder):
Case
When IsEmpty
(ParallelPeriod
([Date].[Calendar Date].[Calendar Year],1,
[Date].[Calendar Date].CurrentMember))
Then 0
When (
KpiValue("Reseller Revenue") -
96 Implementing Data Models and Reports with Microsoft® SQL Server® 2012
(KpiValue("Reseller Revenue"),
ParallelPeriod
([Date].[Calendar Date].[Calendar Year],1,
[Date].[Calendar Date].CurrentMember))
/
(KpiValue ("Reseller Revenue"),
ParallelPeriod
([Date].[Calendar Date].[Calendar Year],1,
[Date].[Calendar Date].CurrentMember)))
>=.02
Then 1
When(
KpiValue("Reseller Revenue") -
(KpiValue ( "Reseller Revenue" ),
ParallelPeriod
([Date].[Calendar Date].[Calendar Year],1,
[Date].[Calendar Date].CurrentMember))
/
(KpiValue("Reseller Revenue"),
ParallelPeriod
([Date].[Calendar Date].[Calendar Year],1,
[Date].[Calendar Date].CurrentMember)))
<=.02
Then -1
Else 0
End
2. In SQL Server Data Tools, on the Build menu of, click Deploy Adventure Works OLAP.
3. When deployment has successfully completed, click Browser View on the toolbar of the KPIs tab,
and then click Reconnect.
4. In the top pane of the KPI browser, click Sales Territory (not Customer – Sales Territory) in the
Dimension list, click Sales Territory Key in the Hierarchy list, and then click Equal in the Operator
list.
5. In the Filter Expression list, expand All, select 1, 2, 3, 4, and 5, and then click OK.
6. Click anywhere in the KPI Browser pane to update the values for the Reseller Revenue KPI.
Answer: A KPI is frequently evaluated over time. Business executives frequently consume
KPIs that are grouped together in a business scorecard to obtain a quick and accurate
historical summary of business success.
Answer: Actions enable business users to act upon the outcomes of their analyses. By saving
and reusing actions, end users can go beyond traditional analysis, which typically ends with
presentation of data, and initiate solutions to discovered problems and deficiencies, thereby
extending the business intelligence application beyond the cube. Actions can transform the
client application from a sophisticated data rendering tool into an integral part of the
enterprise's operational system. Instead of focusing on sending data as input to operational
applications, end users can "close the loop" on the decision-making process. This ability to
transform analytical data into decisions is crucial to the successful business intelligence
application.
Module 10
Implementing a Tabular Data Model with Microsoft
PowerPivot
Contents:
Lesson 1: Introduction to Tabular Data Models and PowerPivot Technologies 99
Lesson 2: Creating a Tabular Data Model by Using PowerPivot for Excel 101
Lesson 1
Introduction to Tabular Data Models and PowerPivot
Technologies
Contents:
Additional Reading 100
100 Implementing Data Models and Reports with Microsoft® SQL Server® 2012
Additional Reading
What Is a Tabular Data Model?
• For more information about DAX, see Module 11 of this course, Introduction to DAX.
Lesson 2
Creating a Tabular Data Model by Using PowerPivot for
Excel
Contents:
Detailed Demonstration Steps 102
2. Start Microsoft Excel 2010, and on the ribbon, click the PowerPivot tab.
3. On the ribbon, click PowerPivot Window. Note that the workbook window is still open, and you can
switch between the windows by clicking the Excel icon on the task bar or by clicking the Switch to
Workbook button in the title bar of the PowerPivot window.
4. In the PowerPivot window, on the ribbon, in the Get External Data area, click From Database, and
then click From SQL Server.
5. In the Table Import Wizard dialog box, change the Friendly connection name to Adventure
Works DW; in the Server name box, type localhost; select Use Windows Authentication, and in
the Database name list, click AdventureWorksDW. Then click Next.
6. On the Choose How to Import the Data Page, choose the option to select from a list of tables and
views, and click Next.
7. On the Select Tables and Views page, select the FactResellerSales table and then click Select
Related Tables.
8. Review the tables that were selected, and unselect DimCurrency and DimPromotion. Then select
DimGeography, DimProductSubcategory and DimProductCategory (which were not
automatically selected because they are not directly related to FactInternetSales).
9. Change the Friendly Name for all selected tables to remove the Dim or Fact prefix.
10. Click the rows for the DimProductCategory table, and then click Preview and Filter. Then in the
Preview Selected Table dialog box, uncheck the SpanishProductCategoryName,
FrenchProductCategoryName, and Image column headers and click OK. This removes columns you
do not plan to use in the data model.
11. Click Finish to create the data model, and when the data for all tables is imported, click Close.
12. Click each tab at the bottom of the PowerPivot window to view the tables in the model. Then, on the
ribbon, in the View section, click Diagram View. This shows the relationships between the tables in
the data model.
13. On the ribbon, in the View section, click Data View to return to the tabbed tables, and click the
ProductCategory tab.
14. Double-click the column header for EnglishProductCategoryName and change the name to
Category.
15. Close the PowerPivot window (but not the Excel workbook).
Implementing Data Models and Reports with Microsoft® SQL Server® 2012 103
2. In the Create PivotTable dialog box, select Existing Worksheet, and click OK.
3. In the PowerPivot Field List pane, expand the ResellerSales table and select SalesAmount. The
total sales amount value is added to the PivotTable.
4. Expand the ProductCategory table and select Category. The sales amount is now aggregated by
product category. Note that PowerPivot has automatically used the relationship from ResellerSales
to ProductCategory through the Product and ProductSubcategory tables in order to aggregate
the data.
3. On the ribbon, click the PowerPivot tab, and then click PowerPivot Window. The PowerPivot
window may open behind the workbook, so minimize the workbook so you can see it.
4. In the PowerPivot window, on the ribbon, in the Get External Data area, click the Refresh drop-
down button and click Refresh All. In the Data Refresh dialog box, when all tables have been
refreshed, click Close.
5. In the PowerPivot window, on the ribbon, in the View area, click Diagram View.
6. In the Sales Territory table, right-click the Sales Territory table header, click Create Hierarchy.,
type Location, and then press Enter.
7. In the Sales Territory table, click Sales Territory Group, drag it onto the Location hierarchy, and
then release it.
8. In the Sales Territory table, click Country, drag it onto the Location hierarchy, and then release it.
9. In the Sales Territory table, click Sales Territory Region, drag it onto the Location hierarchy, and
then release it.
10. Close the PowerPivot window, and return to the workbook and save it, but do not close it. You will
return to it in a later demonstration.
2. Click in cell B2. On the ribbon, on the PowerPivot tab, click PivotTable, and then click PivotTable.
3. In the Create PivotTable dialog box, select Existing Worksheet, and then click OK.
4. In the PowerPivot Field List, expand Reseller Sales, and then select Total Profit to add this column
to the Values area.
5. In the PowerPivot Field List, expand Sales Territory, and then select Location.
2. In the slicer, click 2001, and then wait for the data in the PivotTable table to update.
Additional Reading
Creating and Managing Table Relationships
• For more information about multiple relationships, see the Multiple Relationships topic in Module 11
of this course, Introduction to DAX.
106 Implementing Data Models and Reports with Microsoft® SQL Server® 2012
Lesson 3
Sharing a PowerPivot Workbook and Using PowerPivot
Gallery
Contents:
Detailed Demonstration Steps 107
Implementing Data Models and Reports with Microsoft® SQL Server® 2012 107
2. On the Adventure Works Portal - Home page, in the Libraries list, click PowerPivot Gallery.
3. On the ribbon, click the Documents tab, click the Upload Document drop-down button, and then
click Upload Document.
5. In the Choose File to Upload box, navigate to D:\10778A\Demofiles\Mod10, click Demo.xlsx, and
then click Open.
6. In the PowerPivot Gallery – Upload Document dialog box, click OK. If the PowerPivot Gallery –
Demo.xlsx dialog box appears, click Save.
7. When the large Demo icon appears in the PowerPivot gallery, click it to open the workbook in Excel
Services in the SharePoint site.
8. Click the 2001 slicer and verify that you can interact with the shared workbook.
9. At the top of the workbook page, in the breadcrumbs trail, click Adventure Works Portal. Then
close Internet Explorer.
108 Implementing Data Models and Reports with Microsoft® SQL Server® 2012
Answer: Multidimensional models consist of cubes and dimensions and use Multidimensional
Expressions (MDX). You create them by using Microsoft® Visual Studio®. You should typically use
them for larger, more complex business intelligence (BI) solutions.
Tabular data models, however, consist of tables and relationships and use Data Analysis Expressions
(DAX). You can create them by using PowerPivot for Excel or Visual Studio. You should typically use
them for personal BI scenarios and larger BI solutions that do not require the advanced features of
multidimensional models.
Question: What extra functionality does a SQL Server 2012 Analysis Services tabular data model offer
over a PowerPivot for Excel tabular data model?
Question: How can information workers use the PowerPivot workbooks that individuals upload to
PowerPivot Gallery?
Answer: They can open them in Windows® Internet Explorer®, open them in Microsoft
Excel®, and use them as data sources.
Implementing Data Models and Reports with Microsoft® SQL Server® 2012 109
Module 11
Introduction to DAX
Contents:
Lesson 1: DAX Fundamentals 110
Lesson 1
DAX Fundamentals
Contents:
Additional Reading 111
Implementing Data Models and Reports with Microsoft® SQL Server® 2012 111
Additional Reading
DAX Syntax and Data Types
• Data Types Supported in PowerPivot Workbooks
DAX Queries
• DAX Table Queries
112 Implementing Data Models and Reports with Microsoft® SQL Server® 2012
Lesson 2
Using DAX to Create Calculated Columns and Measures in
a Tabular Data Model
Contents:
Detailed Demonstration Steps 113
3. In the Demo workbook, on the ribbon, on the PowerPivot tab, click PowerPivot Window. The
PowerPivot window may open behind the workbook, so minimize the workbook so you can see it.
5. In the Geography table, scroll across to the last column, double-click Add Column, type Full
Location Name, and then press Enter.
6. In the formula bar above the Geography table, type the DAX formula in the following code example,
and then press Enter.
7. Right-click the State or Province Name column header, and then click Hide from Client Tools.
2. Click the Add Measure Demo tab, and then click PivotTable1.
3. In the PowerPivot Field list, click Refresh if notified that PowerPivot data was modified.
4. In the PowerPivot Field List, right-click Reseller Sales, and then click Add New Measure.
5. In the Measure Settings dialog box, in the Measure Name (all PivotTables) field, type Total Profit.
6. In the Formula field, type the DAX formula in the following code sample, and then click Check
Formula:
3. Expand Product, drag Category to the Row Labels area, and then release it.
114 Implementing Data Models and Reports with Microsoft® SQL Server® 2012
2. In the Column Labels area, click Calendar Year, and then click Move Up. (This groups the two
measures inside each of the years.)
3. In the Column Labels area, drag Values to the Row Labels area. (This nests the two measures inside
each category.)
2. On the ribbon, in the View group, click the Diagram View button.
3. Use the mouse to point to each of the three lines between the Reseller Sales table and the Date
table, one at a time. The lines represent the relationships between the tables.
4. In the PowerPivot window, in the upper-left corner, click the Switch to Workbook button, click the
Multiple Relationships Demo tab, and then click anywhere in PivotTable1.
5. In the PowerPivot Field list, click Refresh if notified that PowerPivot data was modified.
7. Right-click Sales With Ship Date, and then click Edit Formula.
8. In the Measure Settings dialog box, review the formula, and then click Cancel.
9. Drag Sales With Ship Date to the Values area in the PowerPivot Field List, and then release it.
10. In the PowerPivot Field List, expand Date, drag Calendar Year to the Row Labels area, and then
release it.
Additional Reading
Multiple Relationships
• USERELATIONSHIP function
Time Intelligence
• PowerPivot: DAX: Time Intelligence Functions
116 Implementing Data Models and Reports with Microsoft® SQL Server® 2012
Answer: Answers will vary depending upon individuals and their experiences.
Question: Do you have any table relationships for which the ability of DAX to support multiple
relationships might be useful?
Answer: Answers will vary depending upon individuals and their experiences. Suggest common
multiple relationship scenarios such as relationships that involve Date tables.
Question: Will time intelligence functionality be useful to you? What kinds of analyses might you
want to perform?
Answer: Answers will vary depending upon individuals and their experiences. Try to match
students’ suggestions to the relevant time intelligence functions.
Implementing Data Models and Reports with Microsoft® SQL Server® 2012 117
Module 12
Implementing a Tabular Data Model with Microsoft
PowerPivot
Contents:
Lesson 1: Introduction to Analysis Services Tabular Data Model Projects 118
Lesson 1
Introduction to Analysis Services Tabular Data Model
Projects
Contents:
Detailed Demonstration Steps 119
2. Click Start, click All Programs, click Microsoft SQL Server 2012, and then click SQL Server SQL
Server Data Tools.
4. In the New Project dialog box, in the Installed Templates pane, expand Business Intelligence, click
Analysis Services, and then click Import from PowerPivot.
6. Click Browse, navigate to the D:\10778A\Demofiles\Mod12 folder, and then click Select Folder.
7. In the New Project dialog box, click OK. If the Workspace and Deployment Server Configuration
dialog box is displayed, in the Default Server list, select localhost\SQL2, and then click OK (this
dialog box is only displayed the first time you create a tabular model project).
8. In the Open dialog box, navigate to the D:\10778A\Demofiles\Mod12 folder, click Sales, and then
click Open. If a message notifies you that data cannot be imported, click yes to import the metadata.
9. Wait until the creation of the Sales project completes. Note that the data model in the project
includes a tab for each table in the model.
10. On the Tools menu, click Options, and in the Options dialog box, expand Analysis Services and
click Data Modeling. Note the name of the default workspace server used to host the data model
during development. Then click Cancel.
2. In the Edit Connection dialog box, click Impersonation. Then select Specific Windows user name
and password, enter ADVENTUREWORKS\ServiceAcct and Pa$$w0rd, and click OK.
3. In the Edit Connection dialog box, click Save. Then in the Existing Connections dialog box, with the
SqlServer MIA-SQLBI AdventureWorksDW connection selected, click Process to import the data.
4. When processing is complete, in the Data Processing dialog box click Close, and then in the
Existing Connections dialog box, Close. The model is now populated with data.
2. In the Measure Grid, click any empty cell, in the formula bar, type the expression in the code box
below, and then press Enter.
120 Implementing Data Models and Reports with Microsoft® SQL Server® 2012
3. Note that the profit measure is calculated, and then on the File menu, click Save All.
4. Minimize SQL Server Data Tools. You will return to the project in a later demonstration.
Implementing Data Models and Reports with Microsoft® SQL Server® 2012 121
Additional Reading
What Is an Analysis Services Tabular Data Model?
• Determine the Server Mode of an Analysis Services Instance
122 Implementing Data Models and Reports with Microsoft® SQL Server® 2012
Lesson 2
Developing an Analysis Services Tabular Data Model in
SQL Server Data Tools
Contents:
Detailed Demonstration Steps 123
2. On the Build menu, click Deploy Sales. If prompted, enter the user name
ADVENTUREWORKS\ServiceAcct and the password Pa$$w0rd and click OK.
3. In the Deploy dialog box, when deployment is complete, click Close. Then close SQL Server Data
Tools.
4. Under the General Settings area, if a Content Types section exists, review the content types enabled
for this document library. If no Content Types section exists or the BI Semantic Model Connection
is not listed, perform the following steps to enable management of content types and add it.
2. On the SharePoint ribbon, in the Library Tools section, click Documents. Then in the New
Document drop-down list, click BI Semantic Model Connection.
3. In the New BI Semantic Model Connection page, in the File Name box, type Sales; in the
Description box, type Sales data model; in the Workbook URL or Server Name box, type
localhost\SQL2; in the Database (if connecting to a server) box, type Sales; and click OK. After a
few moments, the Sales connection is shown in the PowerPivot Gallery document library.
4. On PowerPivot Gallery page, click the Open New Excel Workbook icon for the Sales BI semantic
model connection.
5. When prompted, click Open. Then, when the download has completed, click Open again.
6. In Excel, in the Microsoft Excel Security Notice dialog box, click Enable.
124 Implementing Data Models and Reports with Microsoft® SQL Server® 2012
7. In the PivotTable Field List pane, select Profit. Then in the Date table, select Calendar Year. Note
that the PivotTable shows profit by year.
8. Close Excel without saving any changes. Then close Internet Explorer.
Implementing Data Models and Reports with Microsoft® SQL Server® 2012 125
Additional Reading
Perspectives
• on security in tabular data models, see the Tabular Data Model Security topic in this module.
126 Implementing Data Models and Reports with Microsoft® SQL Server® 2012
Answer: You might create an Analysis Services Tabular Data Model to scale up an existing PowerPivot
for Excel workbook, enabling you to take advantage of the extra features such as row-level security
and partitioning. You may also choose to create this type of model because it enables you to take
advantage of in-house relational modelling skills to create a departmental or enterprise solution. You
might create an Analysis Services Multidimensional Model for solutions that are more complex, or
which require features, such as translations, that Tabular Data Models do not offer.
Question: How might you use partitions to manage the data that you have in your databases?
Answer: Answer will vary depending on the personal experiences of the students.
Question: What are the advantages of using DirectQuery mode? What features of tabular data
models are not supported in DirectQuery mode?
Answer: DirectQuery mode enables you to use a Tabular Data Model with very large data
sets for which in-memory processing would be impractical. DirectQuery mode does not
support row-level security, calculated columns, pasted or linked tables, or time intelligence
functions.
Implementing Data Models and Reports with Microsoft® SQL Server® 2012 127
Module 13
Creating Data Visualizations with Power View
Contents:
Lesson 1: Introduction to Power View 128
Lesson 1
Introduction to Power View
Contents:
Detailed Demonstration Steps 129
Implementing Data Models and Reports with Microsoft® SQL Server® 2012 129
3. In Solution Explorer, double-click Model.bim. Then click the Customer tab and note that the tables
in the model contain no data.
4. On the Model menu, click Process, and then click Process All. If prompted for impersonation
credentials, specify the user name ADVENTUREWORKS\ServiceAcct and the password Pa$$w0rd,
and then click OK. Wait until processing completes, and then in the Data Processing dialog box, click
Close.
5. On the Date tab, click the Month column and press F4. Then, in the Properties window, in the Sort
by Column drop-down list, select MonthNumberOfYear.
6. On the Product Category tab, click the Product Category column. Then, in the Properties window,
click Default Label, and then in the drop down list, click True.
2. On the Internet Sales tab, click the Order Quantity column. Then in the Properties window, click
Summarize By, and then in the drop down list, change the value to Sum.
2. In Solution Explorer, right click Sales Demo and then click Deploy.
3. When deployment has completed, in the Deploy dialog box, click Close.
Lesson 2
Visualizing Data with Power View
Contents:
Detailed Demonstration Steps 131
Implementing Data Models and Reports with Microsoft® SQL Server® 2012 131
2. Start Internet Explorer and browse to the SharePoint site at http://mia-sqlbi. Then, on the
Adventure Works Portal - Home page, under Libraries, click PowerPivot Gallery.
2. In Content Types, in the Allow management of content types? section, click Yes, and then
click OK.
3. On the Document Library Settings page, in the Content Types section, click Add from
existing site content types.
4. In the Select site content types from: list, click Business Intelligence.
5. In the Available Site Content Types list, click BI Semantic Model Connection, click Add, and
then click OK.
6. On the Document Library Settings page, under Libraries, click PowerPivot Gallery.
7. On the SharePoint ribbon, in the Library Tools section, click Documents. Then in the New
Document drop-down list, click BI Semantic Model Connection.
8. In the New BI Semantic Model Connection page, in the File Name box, type Sales Demo; in the
Description box, type Sales data model; in the Workbook URL or Server Name box, type
localhost\SQL2; in the Database (if connecting to a server) box, type Sales Demo; and click OK.
After a few moments, the Sales Demo connection is shown in the PowerPivot Gallery document
library.
2. In the Power View window, in the fields pane, expand Internet Sales, and then select Internet Sales
Total.
3. On the ribbon, in the Table Tools group, on the Design tab, in the Visualizations area, click
Column.
4. Drag the lower-right corner of the chart and resize it to fill the available space.
5. In the fields pane, expand Date, and then select Calendar Year to add this column to the Axis Fields
field in the Layout Section.
132 Implementing Data Models and Reports with Microsoft® SQL Server® 2012
6. Select Month to add this column to the Series field in the Layout Section.
7. In the chart, in the Month legend, click April. Note that the chart display changes to highlight the
month of April. Click April again to display all months.
8. In the fields pane, expand Geography, and then check Country Region to add this column to the
Vertical Multiples field in the Layout Section.
9. Click in a blank space in the main view area. Then, on the ribbon, on the Home tab, in the Filters
group, click Filters Area.
10. In the fields pane, expand Product Category, drag Product Category to the filters pane, and then
check the Bikes and Clothing check boxes. The report is filtered to show sales for only bikes and
clothing.
2. In the fields pane, under Internet Sales, select Internet Profit; under Date, select Calendar Year,
expand Sales Territory, and select Country; and then in the Visualizations Gallery, click Line.
2. On the File, click Export to PowerPoint, and when prompted, click Save. in the Save As dialog box,
browse to D:\10778A\Demofiles\Mod13, in the File name field, type Internet Review Presentation,
and then click Save.
3. Minimize Internet Explorer, and in the D:\10778A\Demofiles\Mod13 folder, double-click Internet
Review Presentation.pptx to view the exported presentation.
4. View the presentation as a slide show (if notified about a problem with the graphics adapter, click
OK), and then close PowerPoint without saving any changes.
2. In Internet Explorer, in the SharePoint site at http://mia-sqlbi, view the PowerPivot Gallery
document library, and to the right of Sales Demo, click the Create Power View Report icon.
3. In the fields pane, expand Reseller Sales, and click Reseller Sales Total.
4. Drag the lower-right corner of the table and resize it to fill the available space, and then on the
ribbon, in the Visualizations gallery, click Scatter.
5. In the fields pane, under Reseller Sales, click Total Product Cost to add this field to the Y Value box
in the Layout Section.
Implementing Data Models and Reports with Microsoft® SQL Server® 2012 133
6. In the Fields Section, in Reseller Sales, click Reseller Profit to add this field to the Size box in the
Layout Section.
7. In the fields pane, expand Product Subcategory, and click Product Subcategory to add this field to
the Details box in the Layout Section.
8. In the fields pane, expand Date, and drag Calendar Year to the Play Axis box in the Layout Section.
9. On the ribbon, on the Home tab, click Filters Area. Then, in the fields pane, under Product
Category, drag Product Category to the filters pane, and then check only the Bikes check box.
10. Click the scatter chart, and on the ribbon, in the Chart Tools area, click the Layout tab. Then, in the
Labels area, click Data Labels, and then click Right.
11. In the chart, on the Calendar Year play axis, click the Play button. The chart shows a time lapse that
demonstrates how the total cost and sales amount for bikes have both grown over the four year
period.
12. Close Internet Explorer. When prompted, click Leave this page.
134 Implementing Data Models and Reports with Microsoft® SQL Server® 2012
Answer: Power View is an ad hoc data exploration tool, which you can use to create reports that have
a strong visual impact. It is designed for on screen use, where the user can easily change reports as
needed, as well as for creating interactive PowerPoint presentations.
Question: Why is it important to carefully design your tabular data models if you intend to use them
to support Power View reporting?
Answer: The tabular data model that supports a Power View report contains special properties that
enable use of representative images and columns in reports. You can also create custom summary
values in the model to include in the report.
Question: Can you think of any data sets in your workplace that you might explore by using Power
View?
Answer: Answer will vary depending on the personal experiences of the students.
Implementing Data Models and Reports with Microsoft® SQL Server® 2012 135
Module 14
Performing Predictive Analysis with Data Mining
Contents:
Lesson 1: Overview of Data Mining 136
Lesson 1
Overview of Data Mining
Contents:
Detailed Demonstration Steps 137
3. On the ribbon, in the Table Tools group, click the Analyze tab, and then click <No Connection>.
4. In the Analysis Services Connections dialog box, click New, in the Connect to Analysis Services
dialog box, in the Server name field, type (local), in the Catalog name drop-down list, click
DMAddinsDB, and then click OK.
5. In the Analysis Services Connections dialog box, click Close.
2. In the SQL Server Data Mining - Analyze Key Influencers dialog box, in the Column Selection
drop-down list, click Purchased Bike, and then click Run.
3. In the SQL Server Data Mining – Discrimination based on key influencers dialog box, in the
Compare Value 1 drop-down list, click Yes, and then in the to Value 2 drop-down list, click No.
4. Click Add Report, and then click Close.
5. Review the Key Influencers Report for ‘Purchased Bike’ report. Note the values that most strongly
correlate with a customer purchasing a bike.
6. Close Excel, and do not save changes to Table Analysis.xlsx.
138 Implementing Data Models and Reports with Microsoft® SQL Server® 2012
Additional Reading
Components of an Analysis Services Data Mining Solution
• Content Types (Data Mining)
• Plugin Algorithms
Implementing Data Models and Reports with Microsoft® SQL Server® 2012 139
Lesson 2
Creating a Data Mining Solution
Contents:
Detailed Demonstration Steps 140
140 Implementing Data Models and Reports with Microsoft® SQL Server® 2012
2. Click Start, click All Programs, click Microsoft SQL Server 2012, and then click SQL Server Data
Tools.
3. In SQL Server Data Tools, on the File menu, click New, and click Project.
4. In the New Project dialog box, click Analysis Services Multidimensional and Data Mining Project,
in the Name field, type, Mine AW, in the Location field, browse to D:\10778A\Demofiles\Mod14,
and then click OK.
5. In Solution Explorer, right-click Data Sources, and then click New Data Source.
6. In the Data Source Wizard, on the Welcome to the Data Source Wizard page, click Next, and
then on the Select how to define the connection page, click New.
7. In the Connection Manager dialog box, in the Server name field, type localhost, in the Select or
enter a database name drop-down list, click AdventureWorksDW, and then click OK.
8. In the Data Source Wizard, on the Select how to define the connection page, click Next, on the
Impersonation Information page, click Use a specific Windows user name and password, in the
User name field, type ADVENTUREWORKS\Student, in the Password field, type Pa$$w0rd, click
Next, and then on the Completing the wizard page, click Finish.
9. In Solution Explorer, right-click Data Source Views, and then click New Data Source View.
10. In the Data Source View Wizard, on the Welcome to the Data Source View Wizard page, click
Next, on the Select a Data Source page, ensure that Adventure Works DW is selected, and then
click Next.
11. On the Select Tables and Views page, in the Available objects list, click ProspectiveBuyer (dbo),
hold the Ctrl key and click vTargetMail (dbo), and click the > button to move the selected objects to
the Included objects list. Then click Next.
12. On the Completing the Wizard page, in the Name field, type AW DW View, and then click Finish.
2. On the Select the Definition Method page, ensure that From existing relational database or data
warehouse is selected, and then click Next.
3. On the Create the Data Mining Structure page, ensure that the Create mining structure with
mining model radio button is selected, in the Which data mining technique do you want to use?
drop-down list, ensure that Microsoft Decision Trees is selected, and then click Next.
4. On the Select a Data Source View page, select AW DW View and click Next.
Implementing Data Models and Reports with Microsoft® SQL Server® 2012 141
5. On the Specify Table Types page, in the vTargetMail row, select the check box in the Case column,
and then click Next.
6. On the Specify the Training Data page, in the Mining Model Structure table, select the following
columns:
• BikeBuyer: Predictable
• CustomerKey: Key
7. On the Specify Columns’ Content and Data Type page, click Detect and review the content type
and data types found. Ensure that the content type of the Bike Buyer column is identified as
Discrete. Then click Next.
8. On the Create Testing Set page, note that the Percentage of data for testing value is 30%, and
then click Next.
9. On the Completing the Wizard page, in the Mining structure name field, type Purchase
Prediction, in the Mining model name field type Purchase Decision Tree, and then click Finish.
10. On the Build menu, click Deploy Mine AW.
2. Click Start, click All Programs, click Microsoft Office, and then click Microsoft Excel 2010.
3. On the ribbon, on the Data Mining tab, in the Connection area, click DMAddinsDM ((local)), and
then in the Analysis Services Connections dialog box, click New.
4. In the Connect to Analysis Services dialog box, in the Server name field, type (local), in the
Catalog name drop-down list, select Mine AW, and then click OK.
5. In the Analysis Services Connections dialog box, click Close.
2. In the Add Model to Structure Wizard, on the Getting Started with the Add Model to Structure
Wizard page, click Next, on the Select Structure or Model page, ensure that the Purchase
Prediction structure is selected, and then click Next.
3. On the Select Mining Algorithm page, in the Algorithm drop-down list, click Microsoft Naive
Bayes, and then click Next.
4. On the Select Columns page, in the Bike Buyer row, in the Usage column, click Predict Only, in the
Name Style row, in the Usage column, click Do not use, and then click Next.
5. On the Finish page, clear the Browse Model checkbox and click Finish.
142 Implementing Data Models and Reports with Microsoft® SQL Server® 2012
6. On the ribbon, in the Management section, click Manage Models to verify that the model has been
added to the data mining structure, and then click Close.
Lesson 3
Validating a Data Mining Model
Contents:
Detailed Demonstration Steps 144
2. Start SQL Server Management Studio, and when prompted, connect to the localhost instance of
Analysis Services by using Windows authentication.
3. In Object Explorer, expand Databases, expand Mine AW, and expand Mining Structures. Then
right-click the Purchase Prediction mining structure and click View Lift Chart.
4. On the Input Selection tab, note that both mining models are selected with the Bike Buyer column
as predictable, and that the test cases defined in the models themselves will be used for the
validation.
5. Click the Lift Chart tab, and view the lift chart, which compares accuracy for the two mining models
you have created against an ideal model by plotting the number of correct predications against the
number of cases in the overall sample. As the number of cases increases, the ideal model maintains an
accuracy of 100%, but the models you have created tend to become less accurate the more cases
there are.
6. Review the scores in the Mining Legend tab to see which of your models is the most accurate for this
test data.
2. In the Profit Chart Settings dialog box, enter the following values to reflect a marketing campaign
you are planning, and then click OK:
• Population: 20000 (this is the number of potential customers you plan to contact)
• Fixed cost: 1000 (this is the fixed cost of you marketing campaign)
• Individual cost: 3 (this is the cost associated with contacting each customer)
• Revenue per individual: 10 (this is the amount you expect a customer to spend if they respond
positively to the campaign)
3. Review the chart and the Mining Legend tab to evaluate which mining model is likely to generate
the most profitable marketing campaign based on the test data.
2. Review the matrix, noting that for each model it shows the number of times the model predicted a
Bike Buyer value of 0 or 1 on rows, with columns for the actual value of the Bike Buyer column in
the test data.
• Fold Count: 5 (this is the number of partitions used to group the data for analysis)
• Target State: 1 (this is the desired value for the target attribute)
• Target Threshold: 0.1 (this is a value between 0 and 1 that indicates the level of accuracy
required for a prediction to be considered correct)
3. View the resulting report, and note that for each mining model, the results include the following:
• Classifications for true positives, false positives, true negatives, and false negatives.
4. Minimize SQL Server Management Studio – you will use it in the next demonstration.
146 Implementing Data Models and Reports with Microsoft® SQL Server® 2012
Additional Reading
Components of an Analysis Services Data Mining Solution
• Cross-Validation Formulas
Implementing Data Models and Reports with Microsoft® SQL Server® 2012 147
Lesson 4
Consuming Data Mining Data
Contents:
Detailed Demonstration Steps 148
2. Maximize SQL Server Management Studio, and in Object Explorer, right-click the Purchase
Prediction data mining structure and click Browse.
3. In the Mining Model drop-down list, ensure that Purchase - Bayes is selected, and on the
Dependency Network tab, move the slider gradually from All Links to Strongest Links to see which
factors are the strongest predictors that a customer will purchase a bike.
4. On the Attribute Profiles tab, view the color-coded indicators of the values for each column when
compared to customers with a Bike Buyer value of 0 or 1.
5. On the Attribute Characteristics tab, in the Attribute drop-down list, ensure that Bike Buyer is
selected, and in the Value drop-down list, select 1. Then view the probability for each other column
value when the Bike Buyer value is 1.
6. On the Attribute Discrimination tab, in the Attribute drop-down list, ensure that Bike Buyer is
selected, in the Value drop-down list, select 1, and in the Value 2 drop-down list, select 0. Then note
how values for each other column favor a Bike Buyer value of 1 or 0.
7. In the Mining Model drop-down list, select Purchase Decision tree, and on the Decision Tree tab, in
the Background drop-down list, select 1. Then view the decision tree to see how the other column
values influence a value of 1 for Bike Buyer.
2. In Query Designer, in the Mining Model pane, click Select Model, in the Select Mining Model
dialog box, expand Purchase Prediction, click Purchase - Bayes, and then click OK.
3. In the Select Input Table(s) pane, click Select Case Table, in the Select Table dialog box, click
ProspectiveBuyer (dbo), and then click OK.
4. Under the Mining Model pane, in the Source column, click ProspectiveBuyer table, and then in the
Field column, click EmailAddress.
5. Under the row you just added, in the Source column, click Purchase – Bayes mining model, in the
Field column, click Bike Buyer, and in the Criteria/Argument column, type =1.
6. Under the row you just added, in the Source column, click Prediction Function, in the Field column,
click PredictProbability, in the Alias column, type Purchase Probability, and then drag the Bike
Buyer column from the Purchase – Bayes model in the Mining Model pane to the
Criteria/Argument column so that it contain the value [Purchase - Bayes].[Bike Buyer].
7. On the Mining Model menu, click Query to view the DMX code that has been generated.
Implementing Data Models and Reports with Microsoft® SQL Server® 2012 149
8. On the Mining Model menu, click Result to view the query results. The query returns the email
address of every prospective customer who is predicted to buy a bike, along with the probability
(expressed as a percentage in fraction format) that the prediction is accurate.
Additional Reading
Introduction to DMX
• Data Mining Extensions (DMX) Reference
Implementing Data Models and Reports with Microsoft® SQL Server® 2012 151
Answer: The purpose of data mining is to reveal patterns and trends that cannot be discovered by
using standard analysis techniques.
Question: What are the major components of an Analysis Services data mining solution?
Question: What are the main criteria for validating data mining models?
Note Not all training products will have a Knowledge Base article – if that is the case,
please ask your instructor whether or not there are existing error log entries.
Courseware Feedback
Send all courseware feedback to support@mscourseware.com. We truly appreciate your time and effort.
We review every e-mail received and forward the information on to the appropriate team. Unfortunately,
because of volume, we are unable to provide a response but we may use your feedback to improve your
future experience with Microsoft Learning products.
Reporting Errors
When providing feedback, include the training product name and number in the subject line of your e-
mail. When you provide comments or report bugs, please include the following:
Please provide any details that are necessary to help us verify the issue.
Important All errors and suggestions are evaluated, but only those that are validated are
added to the product Knowledge Base article.