Data Analysis Expressions in PowerPivot for Excel 2010

Slides:



Advertisements
Similar presentations
Maths & Trig, Statistical functions. ABS Returns the absolute value of a number The absolute value of a number is the number without its sign Syntax ◦
Advertisements

17-20 OCTOBER 2011 DURBAN ICC. Killer Real-World PowerPivot Examples Kevin Coetzee Online Systems Manager Dimension Data.
Tutorial 7: Using Advanced Functions and Conditional Formatting
Databases Lab 5 Further Select Statements. Functions in SQL There are many types of functions provided. The ones that are used most are: –Date and Time.
Implementing Business Analytics with MDX Chris Webb London September 29th.
EGR 105 Foundations of Engineering I Session 3 Excel – Basics through Graphing Fall 2008.
Introduction Paul Turley SqlServerBiBlog.com Mentor, SQL Server MVP
1 1 The Analyst’s Perspective: Ad-hoc Analysis with Microsoft PowerPivot and Office 2010 Excel Rafal Lukawiecki Strategic Consultant, Project Botticelli.
DAX uses a syntax similar to Excel TableX [ColY] or [ColY] (fully qualified vs. not qualified) Cells cannot be referenced (like B23, B12:C15, …)
Tutorial 8: Working with Advanced Functions
Implementing Common Business Calculations in DAX
Chapter 06: Lecture Notes (CSIT 104) 1 Copyright © 2008 Pearson Prentice Hall. All rights reserved. 1 1 Copyright © 2008 Prentice-Hall. All rights reserved.
1 1 The Analyst's Perspective: Advanced BI with PowerPivot DAX, SharePoint Dashboards, and SQL Data Mining Rafal Lukawiecki Strategic Consultant, Project.
1 1 The Analyst's Perspective: Advanced BI with PowerPivot DAX, SharePoint Dashboards, and SQL Data Mining Rafal Lukawiecki Strategic Consultant, Project.
Syntax MROUND(number,multiple) Number is the value to round. Multiple is the multiple to which you want to round number. Remark MROUND rounds up, away.
MS Excel Management Information Systems 1. Contents 2  Functions  IF Function and nested IF  Sorting Data.  Filtering Data.  Data Form.  Data Validation.
Chapter 11 Creating Formulas that Count and Sum Microsoft Excel 2003.
Microsoft Excel 2007 © Wiley Publishing All Rights Reserved. The L Line The Express Line to Learning L Line.
Microsoft Office Excel 2013 ® ® Abdul Hameed Using Advanced Functions and Conditional Formatting.
Copyright © 2008 Pearson Prentice Hall. All rights reserved Chapter 6 Data Tables and Amortization Tables Exploring Microsoft Office Excel 2007.
PowerPivot For Excel 2010PowerPivot For SharePoint 2010.
CPSC 203 Introduction to Computers Tutorial 03 and 29 By Jie (Jeff) Gao.
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.
Excel 2007 Part (3) Dr. Susan Al Naqshbandi
PERFORMING CALCULATIONS Microsoft Excel. Excel Formulas A formula is a set of mathematical instructions that can be used in Excel to perform calculations.
Chapter 10: Working with Large Data Spreadsheet-Based Decision Support Systems Prof. Name Position (123) University Name.
Example Materials Power BI Desktop File (4/16): 6WPbWY5UTRhaHYwdDA/view?usp=sharing.
about me – Austin Senseman, CFA 5 years in Financial Services, Managed analytics for sales, marketing, risk, finance, &
Level 200 Let‘s learn DAX Tomislav Piasevoli Piasevoli analitika d.o.o.
Microsoft PowerBI – Advanced Solutions with Microsoft Excel and PowerBI Presented by: Phillip Guglielmi, CPA | Senior BI Consultant and Solutions Architect.
John Tran Business Program Manager, The Suddath Companies
Presenter Date | Location
MSAA PRESENTS: AN EXCEL TUTORIAL
Excel FACT Function.
Building Tabular Models
Contents Introduction Text functions Logical functions
Using Advanced Functions and Conditional Formatting
Microsoft Office Access 2010 Lab 3
Excel Functions.
Exploring Excel Chapter 5 List and Data Management: Converting Data to
Chelsea Dohemann Class will start at approximately 8:10am PowerPivot Chelsea Dohemann
Chapter 10 Selected Single-Row Functions Oracle 10g: SQL
Tutorial 5: Working with Excel Tables, PivotTables, and PivotCharts
Microsoft Office Illustrated Introductory, Windows Vista Edition
2007 MICROSOFT EXCEL INTERMEDIATE
Analyzing Table Data.
6/16/2018 © 2014 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks.
REACH Computer Resource Center
Julie Strauss Senior Program Manager Microsoft
Cross UG Summit EMEA /6/2018 7:24 PM
Module 11: Introduction to DAX Module 11 Introduction to DAX
Excel Functions and Tables
Power BI for Excel DAX Functions
11/11/2018 5:18 AM © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Enriching your BI Semantic Models with Data Analysis Expressions (DAX)
Creating and Modifying Queries
Evaluation Context Concepts and Examples.
Chapter 4 Summary Query.
Excel Lookup Formulas Welcome! with Cindy Kredo
Contents Preface I Introduction Lesson Objectives I-2
Introduction to DAX Mike Davis, Consultant Architect.
Introducing DAX July 11th, 2015.
REACH Computer Resource Center
Governing Your Enterprise with Policy-Based Management
Enriching your BI Semantic Models with Data Analysis Expressions (DAX)
Advanced Dashboard Creation with PerformancePoint Services 2010
Microsoft Office Illustrated Introductory, Windows XP Edition
REACH Computer Resource Center
Introduction to SQL Server and the Structure Query Language
Presentation transcript:

Data Analysis Expressions in PowerPivot for Excel 2010 Howie Dickerman Microsoft Corporation

Agenda - Data Analysis Expressions (DAX) PowerPivot for Excel and why we need DAX Demo(s) of Data Analysis Expressions How (and where) to use DAX DAX Functions by Category Excel Functions Relationships Aggregation Table Functions Time Intelligence

PowerPivot Add-In for Excel 2010 PowerPivot for Excel  Self-Service BI PivotTable(s) based on multiple tables of data Ease-of-use: No need to learn multi-dimensional concepts or specialized languages like MDX Data Analysis Expressions (DAX) Simple Excel style formulas Define new fields in the PivotTable field list Enable Excel users to perform powerful data analysis using the skills they already have

Demo 1 PowerPivot Add-In PowerPivot for Excel 2010 Sample Data PowerPivot ribbon in Excel PowerPivot window Sales [Amount] = [Qty]*[Price] Field List with multiple tables Sales PivotTables by customer/product

Data Analysis Expressions (DAX) DAX uses Excel syntax and many Excel functions No notion of addressing individual cells or ranges DAX functions refer to columns in the data DAX is not a replacement for MDX Sample DAX expression Comment = [First Name] &“ ”& [Last Name] String concatenation just like Excel =SUM(Sales[Amount]) SUM function takes a column name instead of a range of cells =RELATED (Product[Cost]) new RELATED function follows relationship between tables

Beyond Excel – Relational data PowerPivot for Excel works with multiple tables of related data, so DAX provides functions that implement relational database concepts: Filter Tables Aggregate over Tables Follow Relationships (fetch data from a related table) Many-to-One One-to-Many

Demo 2 - RELATED and RELATEDTABLE RELATED, RELATEDTABLE in calc columns: Sales [UnitCost] = RELATED (Product[Cost]) Sales [TotalCost] = [Qty]*[UnitCost] Calc column in 3 other tables fetches related transactions and adds up amounts: [Sales]=SUMX(RELATEDTABLE(Sales),Sales[Amount])

Beyond Excel – Dynamic Aggregation DAX has functions to assist with dynamic aggregation of measures in PivotTables Discovery of Filter Context (e.g. What is current product or year?) Modification of Filter Context (e.g. switch to all products or years) Time Intelligence Functions (e.g. compare values to previous period)

Demo 3 – Examine context with VALUES Demo VALUES in Sales PivotTable (Product) Concept of Filter Context - one formula in many cells Demo auto-complete while entering formulas = Values(Time[Year]) & “-” &Values (Product[Name]) = IF (Values(Time[Year])=2007, “Baseline”, “Other”)

Data Analysis Expressions are used in two places: Calculated Columns and Measures Expression (formula) is evaluated for each row in table Column in table is fully populated with values Values may be placed on Pivot Axis or aggregated and then placed in Values area (as a measure) Measures Named expression (formula) is not evaluated until placed into Values area of a PivotTable Measure is evaluated for each PivotTable cell using the “filter context” for that cell (row & column headers) Some measure calculations cannot be accomplished by aggregating a calculated column (e.g. ratios don’t add)

Demo 4 – Creating Measures Row & Column Labels Checkbox or drag/drop places values on axis Values Area SUM(numeric) or COUNT(non-numeric) Two ways to author measures Choose column from table (and choose agg) Enter custom DAX expression (formula) Each measure evaluated w/distinct context for each PivotTable cell

Functions for following relationships Related (Column) Follow existing many-to-one relationship and fetch the value from the specified column in the related table RelatedTable (Table) Follow existing relationship (either direction) and return table containing matching row(s) from the specified table Note that this returns a table, so must be used as a parameter to another function Ex: = SUMX ( RelatedTable(Sales), Sales[Amount]) Excel doesn’t offer table functions, but DAX needs them for intermediate results. (List of table functions to be shown later.)

DAX Aggregation Functions DAX implements aggregation functions from Excel including SUM, AVERAGE, MIN, MAX, COUNT, but instead of taking multiple arguments (a list of ranges,) they take a reference to a column DAX also adds some new aggregation functions which aggregate any expression over the rows of a table SUMX (Table, Expression) AVERAGEX (Table, Expression) COUNTAX (Table, Expression) MINX (Table, Expression) MAXX (Table, Expression)

More than 80 Excel Functions in DAX Date and Time Information Math and Trig Statistical Text DATE ISBLANK ABS AVERAGE CONCATENATE DATEVALUE ISERROR CEILING, ISO.CEILING AVERAGEA EXACT DAY ISLOGICAL EXP COUNT FIND EDATE ISNONTEXT FACT COUNTA FIXED EOMONTH ISNUMBER FLOOR COUNTBLANK LEFT HOUR ISTEXT INT MAX LEN MINUTE LN MAXA LOWER MONTH Logical LOG MIN MID NOW AND LOG10 MINA REPLACE SECOND IF MOD REPT TIME IFERROR MROUND RIGHT TIMEVALUE NOT PI SEARCH TODAY OR POWER SUBSTITUTE WEEKDAY FALSE QUOTIENT TRIM WEEKNUM TRUE RAND UPPER YEAR RANDBETWEEN VALUE YEARFRAC ROUND ROUNDDOWN ROUNDUP SIGN SQRT SUM SUMSQ TRUNC

DAX Table Functions RelatedTable (Table) Filter (Table, Condition) returns table containing related rows of data Filter (Table, Condition) Returns table filtered to include rows where condition is true Distinct (Column) Returns one column table containing the distinct (unique) values in a column Values (Column) Returns one column table containing valid values in a column in current filter context All (Table), All(Column) Returns all data for the specified object, ignoring context filters and without duplicates AllExcept (Table, Col1, Col2,...) Returns all of the data for the specified table, ignoring any context filters EXCEPT that filters for the specified columns are retained

Changing Context and Calculating formulas in the modified context We provide an entire category of functions which are designed to modify the context and then perform calculations in the modified context. These are the CALCULATE functions and ALL functions which have several variants depending on how we want to modify the context of a calculation. The use of a measure as if it were a function is a useful shorthand notation for the CALCULATE function. =[SalesAmt]/[SalesAmt](All(Product))

Demo 5 – DAX measures Sales Table [SalesAmt] = SUM (Sales [Amount]) [AllProd] = CALCULATE ([SalesAmt], All(Product)) = [SalesAmt] (All(Product) [Cost] = SUM (Sales[TotalCost]) [Margin] = Sales[SalesAmt] – Sales[Cost] [Margin%] = (Sales[SalesAmt] – Sales[Cost]) / [Sales]

35 Time Intelligence Functions Manipulating the time period is a very common requirement for Business Intelligence analysis. Time Intelligence requires a Date column in the data and navigates using that column Time Intelligence functions work with intervals of days, months, quarters, and years, and include: Functions that return a single date Functions that return a table of dates Functions that evaluate expressions over time period

Functions that return a single date FirstDate (Date_Column) LastDate (Date_Column) FirstNonBlank (Date_Column, Expression) LastNonBlank (Date_Column, Expression) StartofMonth (Date_Column) StartofQuarter (Date_Column) StartofYear (Date_Column [,YE_Date]) EndofMonth (Date_Column) EndofQuarter (Date_Column) EndofYear (Date_Column [,YE_Date])

Functions that return a table of dates DateAdd (Date_Column, Number_of_Intervals, Interval) DatesBetween (Date_Column, Start_Date, End_Date) DatesInPeriod (Date_Column, Start_Date, Number_of_Intervals, Interval) ParallelPeriod (Date_Column, Number_of_Intervals, Interval) PreviousDay (Date_Column) PreviousMonth (Date_Column) PreviousQuarter (Date_Column) PreviousYear (Date_Column [,YE_Date]) NextDay (Date_Column) NextMonth (Date_Column) NextQuarter (Date_Column) NextYear (Date_Column [,YE_Date]) DatesMTD (Date_Column) DatesQTD (Date_Column) DatesYTD (Date_Column [,YE_Date]) SamePeriodLastYear (Date_Column)

Functions that evaluate expressions over a time period TotalMTD (Expression, Date_Column [, SetFilter]) TotalQTD (Expression, Date_Column [, SetFilter]) TotalYTD (Expression, Date_Column [, SetFilter] [,YE_Date]) OpeningBalanceMonth (Expression, Date_Column [,SetFilter]) OpeningBalanceQuarter (Expression, Date_Column [,SetFilter]) OpeningBalanceYear (Expression, Date_Column [,SetFilter] [,YE_Date]) ClosingBalanceMonth (Expression, Date_Column [,SetFilter]) ClosingBalanceQuarter (Expression, Date_Column [,SetFilter]) ClosingBalanceYear (Expression, Date_Column [,SetFilter] [,YE_Date])

Demo 6 - Time Intelligence Sales Table [YOYGrowth] = [SalesAmt] – [SalesAmt](DateAdd(Time[Date],-1,Year)) [QTDSales] = TotalQTD ([SalesAmt], Time[Date]) [YearAgo] = [SalesAmt] (ParallelPeriod(Time[Date],-12,Month)) CTP Note: In the CTP3 release, it is necessary to add All(Time) as an additional filter to the Time Intelligence invocations so the time selection won’t be restricted by the current filter context.

Summary DAX formulas use familiar Excel syntax: Calculated Columns (in PowerPivot tables) Measures (in PivotTable UI) Functionality includes: Excel functions (math, statistical, date/time, text, etc.) Aggregation of any expression over a table Table functions (Filter(), RelatedTable(), Distinct(), etc.) Fetch data across relationships (one-many, many-one) Set or modify calculation context (All, Calculate, etc.) Time Intelligence functions

Call To Action / Resources Visit website: http://PowerPivot.com Download these two applications and try out DAX! Microsoft Office 2010 (Beta) SQL Server PowerPivot for Excel 2010 (CTP3 ) Product Team Blog Site: http://blogs.msdn.com/powerpivot DAX Questions? e-mail: howied@microsoft.com

Complete the Evaluation Form & Win! You could win a Dell Mini Netbook – every day – just for handing in your completed form! Each session form is another chance to win! Pick up your Evaluation Form: Within each presentation room At the PASS Booth near registration area Drop off your completed Form: Near the exit of each presentation room Sponsored by Dell

PASS PowerPivot Sweepstakes Become a follower of www.twitter.com/powerpivot Re-tweet our message: “Want to learn more, go to www.powerpivot.com and sign up for CTP #powerpivot” You are entered to win an XBOX 360 We will randomly select a follower who re-tweeted this and announce the winner The results will be posted on Monday, November 9th at www.twitter.com/powerpivot *No Purchase Necessary. Open only to residents 18+ of the 50 US (includes D of C) or Canada (excluding Quebec). Game ends 11/5/09. For full Official Rules, visit www.powerpivot.com/contest

for attending this session and the 2009 PASS Summit in Seattle Thank you for attending this session and the 2009 PASS Summit in Seattle