Module 11: Introduction to DAX Module 11 Introduction to DAX

Slides:



Advertisements
Similar presentations
Microsoft Office XP Microsoft Excel
Advertisements

Copyright © 2013 by The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill/Irwin TECHNOLOGY PLUG-IN T3 PROBLEM SOLVING USING EXCEL.
BUSINESS DRIVEN TECHNOLOGY Decision Analysis Tools in Excel
McGraw-Hill/Irwin ©2008 The McGraw-Hill Companies, All Rights Reserved TECHNOLOGY PLUG-IN T4 PROBLEM SOLVING USING EXCEL Goal Seek, Solver & Pivot Tables.
Decision Analysis Tools in Excel
© Paradigm Publishing, Inc Excel 2013 Level 2 Unit 1Advanced Formatting, Formulas, and Data Management Chapter 4Summarizing and Consolidating Data.
Tutorial 5: Working with Excel Tables, PivotTables, and PivotCharts
Chapter 6: Pivot Tables Spreadsheet-Based Decision Support Systems Prof. Name Position (123) University Name.
Managing Grades with Excel Viewing Help To view Help 1.Open Excel on your computer. 2.In the top right hand corner of the Excel Screen type in the.
Integrating Access with the Web and with Other Programs.
Microsoft Excel 2010 Chapter 8
COMPREHENSIVE Excel Tutorial 8 Developing an Excel Application.
Tutorial 5: Working with Excel Tables, PivotTables, and PivotCharts
EXCEL ADVANCED 1. Mathematical Operators for Excel < > = >=
Working with Reports in Microsoft Excel Session Version 1.0 © 2011 Aptech Limited.
© 2008 The McGraw-Hill Companies, Inc. All rights reserved. ACCESS 2007 M I C R O S O F T ® THE PROFESSIONAL APPROACH S E R I E S Lesson 6 – Designing.
PIVOT TABLES AND CHARTS CS1100 Computer Science and its Applications CS1100Pivot tables and charts1.
Copyright 2008 McGraw-Hill Ryerson 1 TECHNOLOGY PLUG-IN T7 PROBLEM SOLVING USING ACCESS.
A lesson approach © 2011 The McGraw-Hill Companies, Inc. All rights reserved. a lesson approach Microsoft® Excel 2010 © 2011 The McGraw-Hill Companies,
McGraw-Hill/Irwin © 2008 The McGraw-Hill Companies, All Rights Reserved Plug-In T7: Problem Solving Using Access 2007 Business Driven Technology.
XP. Objectives Sort data and filter data Summarize an Excel table Insert subtotals into a range of data Outline buttons to show or hide details Create.
Lesson 7 – Microsoft Excel 2010 Working with Tables, PivotTables, and PivotCharts.
Highline Class, BI 348 Basic Business Analytics using Excel Introduction to PowerPivot 1.
T7-1 LEARNING OUTCOMES – ACCESS PROBLEM SOLVING 1.Describe the process of using the Simple Query Wizard using Access 2.Describe the process of using the.
Spreadsheets What is Excel?. Objectives 1. Identify the parts of the Excel Screen 2. Identify the functions of a spreadsheet 3. Identify how spreadsheets.
Microsoft Excel 2013 Chapter 8 Working with Trendlines, PivotTable Reports, PivotChart Reports, and Slicers.
Excel part 5 Working with Excel Tables, PivotTables, and PivotCharts.
XP New Perspectives on Microsoft Office Access 2003, Second Edition- Tutorial 8 1 Microsoft Office Access 2003 Tutorial 8 – Integrating Access with the.
McGraw-Hill/Irwin © 2008 The McGraw-Hill Companies, All Rights Reserved Plug-In T7: Problem Solving Using Access 2007 Business Driven Technology.
Microsoft ® Excel ® 2013 Enhanced Tutorial 5: Working with Excel Tables, PivotTables, and PivotCharts.
By Martha Nelson Digital Learning Specialist Excel Pivot Tables.
Microsoft Office Tips Pivot tables. Agenda Learn how to create and use PivotTables Q&A Excel 2010 is very similar to 2007, I have tried to demonstrate.
Chapter 8 Working with Trendlines, PivotTable Reports, PivotChart Reports, and Slicers Microsoft Excel 2013.
Excel Tutorial 8 Developing an Excel Application
Using Macros, Switchboards, PivotTables, and PivotCharts
Creating Oracle Business Intelligence Interactive Dashboards
Tutorial 5: Working with Excel Tables, PivotTables, and PivotCharts
Copyright © Bird Media LLC
PIVOT TABLE BASICS.
Microsoft Office Illustrated
Plug-In T7: Problem Solving Using Access 2007
Microsoft Excel A Spreadsheet Program.
MS-Excel Part 1.
Microsoft Excel 101.
Using Window Ranking, Offset, and Aggregate Functions
Module 1: Introduction to Business Intelligence and Data Modeling
Advanced Microsoft Excel
Module 10: Implementing a Tabular Data Model with Microsoft PowerPivot
MODULE 7 Microsoft Access 2010
Module 13: Creating Data Visualizations with Power View
Navya Thum February 13, 2013 Day 7: MICROSOFT EXCEL Navya Thum February 13, 2013.
Module 12: Implementing an Analysis Services Tabular Data Model
Microsoft Office Access 2003
Module 7: Working with Measures and Measure Groups
Microsoft Office Access 2003
Module 3: Supporting Self Service Reporting
Module 9: Customizing Cube Functionality
Introduction to Computer Applications West Virginia University
Introduction to Database Programs
Topic 8 – Pivot tables and Charts Lesson 1 – Pivot tables
REACH Computer Resource Center
Introduction to Database Programs
Microsoft Excel PowerPivot ….light & Easy
Assignment resource Working with Excel Tables, PivotTables, and Pivot Charts Fairhurst pp The commands on these slides work with the Week 2 Excel.
Module 5: Creating Multidimensional Databases
Module 6: Working with Cubes and Dimensions
Module 14: Performing Predictive Analysis with Data Mining
Module 8: Introduction to MDX Module 8 Introduction to MDX
Presentation transcript:

Module 11: Introduction to DAX Module 11 Introduction to DAX Course 10778A Module 11: Introduction to DAX Module 11 Introduction to DAX

Module 11: Introduction to DAX Course 10778A Module Overview Module 11: Introduction to DAX DAX Fundamentals Using DAX to Create Calculated Columns and Measures in a Tabular Data Model

Lesson 1: DAX Fundamentals Course 10778A Lesson 1: DAX Fundamentals Module 11: Introduction to DAX Overview of DAX DAX Functions DAX Syntax and Data Types Aggregations Context DAX Queries

Module 11: Introduction to DAX Course 10778A Overview of DAX Module 11: Introduction to DAX DAX is a formula-based language for building business logic and queries in tabular data models: Calculated columns Measures Queries Its syntax is similar to Microsoft Excel formulas: It uses functions, operators, and values It is easy to use and already familiar to information workers It differs from Excel formulas in key ways: It is designed to work with relational data, not data ranges It includes more advanced functionality There are new functions to expand DAX

Module 11: Introduction to DAX Course 10778A DAX Functions Module 11: Introduction to DAX Text functions Information functions Filter and value functions Logical functions Mathematical and trigonometric functions Statistical and aggregation functions Date and time functions Time intelligence functions For more information about the Data Analysis Expressions (DAX) function reference for Microsoft® SQL Server® 2012, see the “DAX Function Reference” at http://go.microsoft.com/fwlink/?LinkID=248848.

DAX Syntax and Data Types Course 10778A DAX Syntax and Data Types Module 11: Introduction to DAX DAX formulas start with the equal sign (=) followed by an expression Expressions can contain functions, operators, constants, and references to columns Column references: Fully qualified name: Unqualified name: Measure names must be enclosed in brackets DAX uses eight data types For the full syntax specification, see “DAX Syntax Specification for PowerPivot” at http://go.microsoft.com/fwlink/?LinkID=248849. 'table name'[column name] [column name]

Module 11: Introduction to DAX Course 10778A Aggregations Module 11: Introduction to DAX Summarize underlying detailed data for analysis Use automatic aggregation for simple calculations: SUM COUNT MIN MAX AVERAGE Create a measure for more complex aggregations SUM('Reseller Sales'[Sales Amount])

Module 11: Introduction to DAX Course 10778A Context Module 11: Introduction to DAX A DAX measure or calculated column defines a field that you can use in a PivotTable table or a PivotChart chart The exact values that appear in PivotTable tables and PivotChart charts vary with context: Row context Query context Filter context

Module 11: Introduction to DAX Course 10778A DAX Queries Module 11: Introduction to DAX Client applications, such as the Power View reporting tool, issue DAX queries You can write queries manually by using the DAX query language You can filter, order, and summarize results EVALUATE( FILTER('Reseller Sales', 'Reseller Sales'[OrderDateKey]>20040101))

Module 11: Introduction to DAX Course 10778A Lesson 2: Using DAX to Create Calculated Columns and Measures in a Tabular Data Model Module 11: Introduction to DAX Calculated Columns Measures Multiple Relationships Time Intelligence Dynamic Measures

Module 11: Introduction to DAX Course 10778A Calculated Columns Module 11: Introduction to DAX Named columns that are populated by using a DAX formula Create calculated columns in the Data View window of a PowerPivot for Excel workbook: Add a new column Provide a name Enter a DAX expression in the formula bar A value is calculated for each row in the table when the calculated column is created Use calculated columns in PivotTable tables, PivotChart charts, slicers, and measure definitions =CONCATENATE('Employee'[First Name], CONCATENATE(" ", 'Employee'[Last Name]))

Module 11: Introduction to DAX Course 10778A Measures Module 11: Introduction to DAX Named formulas that can contain sophisticated business logic: Implicit measures Explicit measures Create explicit measures in two places: The PowerPivot Field List in an Excel worksheet The Measure Grid in the table view in the PowerPivot window Use measures in PivotTable tables and Pivot Chart charts IF([Previous Year], ([Sum of Sales Amount] – [Previous Year])/[Previous Year], BLANK())

Demonstration: Creating and Using Measures and Calculated Columns Course 10778A Demonstration: Creating and Using Measures and Calculated Columns Module 11: Introduction to DAX In this demonstration, you will see how to: Create a calculated column Create a measure Use measures and calculated columns in PivotTable tables and PivotChart charts Use measures to create different groupings of data Task 1: Create a calculated column Ensure that the MIA-DC1 and MIA-SQLBI virtual machines are both running, and then log on to MIA- SQLBI as ADVENTUREWORKS\Student with the password Pa$$w0rd. Then in the D:\10778A\Demofiles\Mod11 folder, run Setup.cmd as Administrator. In the D:\10778A\Demofiles\Mod11 folder, double-click the Demo.xlsx file. In the Demo workbook, click the PowerPivot tab, and then on the PowerPivot ribbon, click PowerPivot Window. In the PowerPivot window, click the Geography tab. In the Geography table, scroll across to the last column, double-click Add Column, type Full Location Name, and then press Enter. In the formula bar above the Geography table, type the DAX formula in the following code example, and then press Enter. =CONCATENATE([State or Province Name], CONCATENATE(“, “,[Region Name])) Right-click the State or Province Name column header, and then click Hide from Client Tools. Task 2: Create a measure In the PowerPivot window, in the upper-left corner, click the Switch to Workbook button. Click the Add Measure Demo tab, and then click PivotTable1. In the PowerPivot Field list, click Refresh if notified that PowerPivot data was modified. In the PowerPivot Field List, right-click Reseller Sales, and then click Add New Measure. In the Measure Settings dialog box, in the Measure Name (all PivotTables) field, type Total Profit. In the Formula field, type the DAX formula in the following code example, and then click Check Formula: =SUM(‘Reseller Sales’[Sales Amount]) – SUM(‘Reseller Sales’[Total Product Cost]) In the Category field, click Currency, and then click OK. Task 3: Use measures in a PivotTable table and a PivotChart chart When the you create the Total Profit measure, it should automatically appear in the PivotTable1 table. If it does not, in the PowerPivot Field List, expand Reseller Sales, and then select Total Profit. In Reseller Sales, select Sales Amount. Expand Product, drag Category to the Row Labels area, and then release it.

Multiple Relationships Course 10778A Multiple Relationships Module 11: Introduction to DAX Tabular data models support multiple relationships between tables Only one relationship is active at a time The active relationship is used by default in DAX formulas The USERELATIONSHIP function enables you to select the relationship that you want to use for a specific formula =CALCULATE(SUM(Reseller Sales[Sales Amount]), USERELATIONSHIP(Reseller Sales[ShipDateKey],Date[DateKey]))

Demonstration: Using a Specific Relationship in a Measure Course 10778A Demonstration: Using a Specific Relationship in a Measure Module 11: Introduction to DAX In this demonstration, you will see how to: Use the USERELATIONSHIP function to specify the relationship to use in a formula Task 1: Specify the relationship to use in a formula In the Demo workbook, click the PowerPivot tab, and then on the PowerPivot ribbon, click PowerPivot Window. On the ribbon, in the View group, click the Diagram View button. Rest the cursor arrow on 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. 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. In the PowerPivot Field list, click Refresh if notified that PowerPivot data was modified. In the PowerPivot Field List, expand Reseller Sales. Right-click Sales With Ship Date, and then click Edit Formula. In the Measure Settings dialog box, review the formula, and then click Cancel. Drag Sales With Ship Date to the Values area in the PowerPivot Field List, and then release it. In the PowerPivot Field List, expand Date, drag Calendar Year to the Row Labels area, and then release it. Close Demo.xlsx and do not save changes.

Module 11: Introduction to DAX Course 10778A Time Intelligence Module 11: Introduction to DAX Compare data from one time period against equivalent data from a different time period The tabular model should contain a separate table that contains only date information The date table should have a continuous range of dates without any gaps The column in the date table that uses the date data type should use day as the lowest level of granularity Mark the table as Date Table to use time intelligence functions against that table Use time intelligence functions to build measures CALCULATE([Sum of Sales Amount], DATEADD('Date'[FullDateAlternateKey], -1, YEAR))

Module 11: Introduction to DAX Course 10778A Dynamic Measures Module 11: Introduction to DAX Calculate different values for each row in a PivotTable table: Create a linked table that contains the input values for the dynamic measure Use the HASONEVALUE function to check that there is a single input value for each row Use conditional logic to apply different calculations to each row based on the input value IF([Check Single Values)], SWITCH(VALUES('Time Period'[Period]), "Current Year", [Sum Of Sales Amount], "Previous Year" [Previous Year], "YOY Growth" , IF(NOT(ISBLANK([Previous Year])), [Sum of Sales Amount] – [Previous Year], BLANK())), BLANK())

Module 11: Introduction to DAX Course 10778A Lab Scenario Module 11: Introduction to DAX As a senior business analyst at Adventure Works Cycles, you want to perform some detailed analysis of the data in tabular data model. Specifically, you want to: View the full name of each employee and aggregate sales data based on the reporting hierarchy of sales employees and managers View the sales contribution of each sales employee and manager as a percentage of the total sales achieved View year on year sales growth as a percentage View sales values for the current year and previous year, and show the year on year growth as a monetary value Students will perform the lab in the role of a data analyst in the Adventure Works Cycles company, and: Create calculated columns in a PowerPivot Excel workbook. Create measures. Upload the Power Pivot workbook to SharePoint and view it there. Use the PowerPivot workbook in SharePoint as a data source for an Excel PivotTable Point out that the instructions in the lab are deliberately designed to be high-level so that students need to think carefully about what they are trying to accomplish and work out how best to proceed for themselves. Encourage students to read the scenario information carefully and collaborate with each other to meet the scenario requirements. Remind students that if they find a particular task or exercise too challenging, they can find step-by-step instructions in the lab answer key.

Lab 11: Creating Calculated Columns and Measures by Using DAX Course 10778A Lab 11: Creating Calculated Columns and Measures by Using DAX Module 11: Introduction to DAX Exercise 1: Creating Calculated Columns Exercise 2: Creating Measures Exercise 3: Using Time Intelligence Exercise 4: Creating a Dynamic Measure In this lab, students will create calculated columns, use calculated columns to create a hierarchy, create and reuse measures, create a measure that uses time intelligence, and create a dynamic measure. Exercise 1 In this exercise, students will create a calculated column by using the CONCATENATE function. Then, they will use the PATH, PATHITEM, and LOOKUPVALUE functions to create calculated columns to support a parent-child relationship hierarchy. Finally, they will use the hierarchy in a PivotTable table. Exercise 2 In this exercise, students will create a measure that uses the CALCULATE and ALL functions to calculate total sales for all employees. Then, they will reuse this measure to calculate the percentage of sales per employee. Finally, they will use these measures in a PivotTable table and add conditional formatting. Exercise 3 In this exercise, students will mark a table as Date Table and use the DATEADD function to create a measure. Then, they will reuse this measure to calculate year-on-year growth. Exercise 4 In this exercise, students will create a linked table and use the HASONEVALUE function to create a measure that checks input values. Then, they will use the IF, SWITCH, VALUES, NOT, ISBLANK, and BLANK functions to create a dynamic measure. Logon information Virtual machine MIA-SQLBI User name ADVENTUREWORKS\Student Password Pa$$w0rd Estimated time: 60 minutes

Module Review and Takeaways Course 10778A Module Review and Takeaways Module 11: Introduction to DAX Do you or your colleagues use Excel formulas? What limitations have you encountered? What features of DAX might help you to overcome these limitations? Do you have any table relationships for which the ability of DAX to support multiple relationships might be useful? Will time intelligence functionality be useful to you? What kinds of analyses might you want to perform? Review Questions Point the students to the appropriate section in the course so that they are able to answer the questions presented in this section. Some guidance for discussing the answers to the questions is included below. Do you or your colleagues use Excel formulas? What limitations have you encountered? What features of DAX might help you to overcome these limitations? Answers will vary depending upon individuals and their experiences. Do you have any table relationships for which the ability of DAX to support multiple relationships might be useful? Answers will vary depending upon individuals and their experiences. Suggest common multiple relationship scenarios such as relationships that involve Date tables. Will time intelligence functionality be useful to you? What kinds of analyses might you want to perform? Answers will vary depending upon individuals and their experiences. Try to match students’ suggestions to the relevant time intelligence functions.