Академический Документы
Профессиональный Документы
Культура Документы
www.pragmaticworks.com
Class Logistics
Dan Clark (dclark@pragmaticworks.com) Make it Interactive!!! Mute when not talking to class. Let me know if sound or video cuts out. Have Fun This is cool stuff!!!
www.pragmaticworks.com
Introductions
www.pragmaticworks.com
Agenda - Day 1
Introduction to PowerPivot Importing Data Creating the Data Model Calculations with DAX Lab Setup
www.pragmaticworks.com
Agenda - Day 2
Creating Measures Time Intelligence PivotTables PivotCharts
www.pragmaticworks.com
Agenda - Day 3
Tabular Data Models in SSAS Understanding Context with DAX Advanced Data Analysis Managing and Securing Tabular Models
www.pragmaticworks.com
www.pragmaticworks.com
www.pragmaticworks.com
www.pragmaticworks.com
Installing PowerPivot
Free Add-in to Excel 2010 32bit version supports 2GB files 64bit version supports 4GB files Windows XP SP3 32bit only Windows 7 32bit and 64bit versions
www.pragmaticworks.com
www.pragmaticworks.com
http://pragmaticworks.com/PowerPivotForTechies.zip
www.pragmaticworks.com
www.pragmaticworks.com
www.pragmaticworks.com
www.pragmaticworks.com
www.pragmaticworks.com
www.pragmaticworks.com
www.pragmaticworks.com
www.pragmaticworks.com
www.pragmaticworks.com
www.pragmaticworks.com
www.pragmaticworks.com
Denormalizing Data
When to Denormalize Denormalizing After Loading Data
Using the Related Function
www.pragmaticworks.com
Linked Tables
Table created in Excel Linked to a Table in PowerPivot Changes to Linked Tables Automatically Reflect the Changes in PowerPivot.
www.pragmaticworks.com
Hierarchies
Organize Attributes Natural Hierarchies
Year Quarter Month Country Region City
www.pragmaticworks.com
www.pragmaticworks.com
www.pragmaticworks.com
Why DAX?
Easier Data Analysis Larger User Base Leverage Excel
Formula Syntax PivotTables
www.pragmaticworks.com
Data Types
Whole Number Decimal Number Currency True/False Text Date Binary
www.pragmaticworks.com
DAX Operators
MarginPercent =[Margin]/[TotalCost]
Type Arithmetic operator Symbol + (plus sign) (minus sign) Use Addition Subtraction Negation
* (asterisk)
/ (forward slash) ^ (caret) Comparison operator =
Multiplication
Division Exponentiation Equal to
>
< >= <= <>
MAKING BUSINESS INTELLIGENT
Greater than
Less than Greater than or equal to Less than or equal to Not equal to
www.pragmaticworks.com
! (NOT)
Parenthesis operator
MAKING BUSINESS INTELLIGENT
()
www.pragmaticworks.com
www.pragmaticworks.com
www.pragmaticworks.com
www.pragmaticworks.com
Math Functions
Ceiling Log Round Random Trunc
AdjustedPrice=CEILING([ProductPrice],0.05)
www.pragmaticworks.com
Navigation Functions
Getting a Value From a Related Table Getting a Set of Values From a Related Table Filtering Values from a Related Table
ProductCategory=Related('ProductCategory'[ProductCategoryName])
StoreCount=COUNTX(RELATEDTABLE(Store),Store[EntityKey])
www.pragmaticworks.com
www.pragmaticworks.com
www.pragmaticworks.com
Measures
Named Formulas Defined in Measures Grid Used in Values Area of PivotTable Evaluated on the Fly Evaluated Separately for Each Cell
www.pragmaticworks.com
Filter Context
Applied by Filter Constraints Row and Column Headers Slicers and Filters DAX Formula Filters
www.pragmaticworks.com
Aggregation
Aggregating a column
SUM, AVERAGE, COUNT, DISTINCTCOUNT, MIN, MAX
www.pragmaticworks.com
Final Result is a single Value Expression is Aggregate SetFilter Modifies Filter Context
Boolean Expression Table Expression
AllProductSales:=CALCULATE([TotalSales], ALL(Product))
www.pragmaticworks.com
Miscellaneous Functions
Rank
Ranks Value in List of Values
TopN
Returns Aggregate of Top or Bottom Values
SalesTotal =SUM(Sales[SalesAmount]) Bottom10ProductSales =SUMX(TOPN(10, Product, [SalesTotal], 1), [SalesTotal]) ColorRank:=RANKX(ALL(Product[ColorName]), [SalesTotal])
www.pragmaticworks.com
Values
Returns Valid Values for the Column Based on Current Filter Context Often Used in IF Function
USERELATIONSHIP(FactSales[ShipDateKey], Date[DateKey]) VALUES(Geography[RegionCountryName]) = United States
MAKING BUSINESS INTELLIGENT
www.pragmaticworks.com
www.pragmaticworks.com
www.pragmaticworks.com
www.pragmaticworks.com
PREVIOUSMONTH(Date[DateKey])
LNBDate:=LASTNONBLANK('Date'[Datekey],[BaseQty])
DATESYTD(Date[DateKey])
www.pragmaticworks.com
www.pragmaticworks.com
Semi-additive Measures
Aggregated Using SUM Over Some Dimensions Different Aggregation Over Other Dimensions (Date/Time) Examples
Balances Inventory Levels
MAKING BUSINESS INTELLIGENT
www.pragmaticworks.com
www.pragmaticworks.com
www.pragmaticworks.com
PivotTable Fundamentals
Field List
Values, Labels, Filters, and Slicers Numeric Fields Default to Values Text Fields Default to Labels Hiding Fields and Tables
www.pragmaticworks.com
Filtering
Label Filters Value Filters Showing Top Values
Formatting
Using PivotTable Tools Design Tab Conditional Formatting
www.pragmaticworks.com
Adding Calculations
Showing Values as % of Total Ranking Values Aggregating Values Inserting Columns
Convert to Values Convert to Cube Formulas
=CUBEVALUE("PowerPivot Data",$C7,E$6,Slicer_Year,Slicer_Quarter,Slicer_ResellerSize)
www.pragmaticworks.com
Banding
Convert Continuous Values into Buckets
Age Ranges, Pricing, Income
Use a Table Defining Band Ranges Use Calculate Function to Select Band
MAKING BUSINESS INTELLIGENT
www.pragmaticworks.com
www.pragmaticworks.com
www.pragmaticworks.com
PivotTable Visualization
Data Bars Sparklines
www.pragmaticworks.com
Flattened PivotTables
Uses Standard Table Layout Useful for Reports and Printing
www.pragmaticworks.com
www.pragmaticworks.com
www.pragmaticworks.com
www.pragmaticworks.com
www.pragmaticworks.com
www.pragmaticworks.com
www.pragmaticworks.com
Solution Explorer
Container for Project .bim File Contains Database Definition, Metadata, Copy and Pasted Data
MAKING BUSINESS INTELLIGENT
www.pragmaticworks.com
Importing Data
Data Sources
Relational Databases Analysis Service Cubes Imported as Flattened Data Excel Files Power Pivot Workbook - Hosted on SharePoint Text Files Data Feeds Atom Feeds, Reporting Services Reports
www.pragmaticworks.com
Table Relations
Relate Tables Together by Common Column Composite Keys not Supported
Use a Calculated Column
Types
One-To-Many One-To-One
www.pragmaticworks.com
www.pragmaticworks.com
www.pragmaticworks.com
www.pragmaticworks.com
Row Context
Calculated column
Row Context Includes All Values in Current Row
Multiple Tables
RELATED Function propagates Row Context
Must be a Relationship Defined in the Model Uses Active Relationship by Default Propagates From the One Side to the Many Side
Discount = SALES[Price] * (1 - RELATED(CustomerDiscount[Discount]))
SalesCount = SUMX(RELATEDTABLE(Sales),Sales[OrderQuantity])
MAKING BUSINESS INTELLIGENT
www.pragmaticworks.com
Filter Context
Added When a Filter Constraint is Used Alters the Query Context
SUMX(Filter(Sales,Sales[OrderQuantity]>5),SALES[SalesAmount])
www.pragmaticworks.com
www.pragmaticworks.com
KEEPFILTERS function
Filters Override any Existing Column Filter
Hierarchies Filter Context is Cleared Causes Problems Rolling Up the Data
www.pragmaticworks.com
www.pragmaticworks.com
www.pragmaticworks.com
www.pragmaticworks.com
Creating KPIs
Used to Gauge Performance of a Value Often used on a Business Scorecard Usually Displayed in Graphical Format
Red, Yellow, Green
Base Value
Defined by a Measure
Target Value
Defined by Measure or Absolute Value
Status Thresholds
Defined by Range Between a low and High Value
MAKING BUSINESS INTELLIGENT
www.pragmaticworks.com
www.pragmaticworks.com
Intermediate Table used to Join Tables Not Supported by Model Designer Simulated With DAX
www.pragmaticworks.com
Two Copies of the Product Table Inactive Relationship Defined Between Sales Table and Product Tables Filter Customers Who Bought One Set of Products Check if They Bought a Product From the Other Set
MAKING BUSINESS INTELLIGENT
www.pragmaticworks.com
www.pragmaticworks.com
www.pragmaticworks.com
Implementing Perspectives
Define Viewable Subsets of a Model Provide Business-Specific Viewpoints Tables, Columns, and Measures are Defined as Field Objects Select the Viewable Fields for Each Perspective Not Meant to be Used for Security Tool for Providing a Better User Experience
MAKING BUSINESS INTELLIGENT
www.pragmaticworks.com
Process
Can Run Processing Operations
Administrator
Can Make Modifications to the Model Schema Can Query All Data
MAKING BUSINESS INTELLIGENT
www.pragmaticworks.com
www.pragmaticworks.com
Processing Partitions
Option Add Description Adds new rows to a partition. Any affected calculated columns, relationships, user hierarchies, or internal engine structures (except table dictionaries) are recalculated. Drops all the data in a database, table, or partition. Loads data into a partition or table.
Clear Data
Default
Loads data into unprocessed partitions or tables. Any affected calculated columns, relationships, user hierarchies, or internal engine structures (except table dictionaries) are recalculated.
Loads data into all selected partitions or tables. Any affected calculated columns, relationships, user hierarchies, or internal engine structures (except table dictionaries) are recalculated. For all tables in the database, recalculates calculated columns, rebuilds relationships. rebuilds user hierarchies, and rebuilds other internal engine structures.
www.pragmaticworks.com
Full
Recalc
Deployment Options
SQL Server Data Tools (SSDT)
Set Deployment Properties Server, Database, Cube Name, Processing
www.pragmaticworks.com
www.pragmaticworks.com
Resources
Web Sites http://technet.microsoft.com/en-us/library/gg399181.aspx http://powerpivot-info.com http://blogs.msdn.com/b/analysisservices/ http://www.bidn.com Books http://www.amazon.com/Microsoft-PowerPivot-Excel-2010Meaning/dp/0735640580 http://www.amazon.com/gp/product/0071746854/
MAKING BUSINESS INTELLIGENT
www.pragmaticworks.com