Building Tabular Models Pragmatic Works Dan Clark dclark@pragmaticworks.com
Advantages of using Tabular Data Models in SSAS Scalability Manageability Security Development Tools
The xVelocity Engine Fast Performance Columnar Database Data Compression In-memory Storage Calculations on the Fly Table Model
Importing Data from a Database The Table Import Wizard Tables and Views Previewing Queries Stored Procedures
Importing Data from a File Importing from Excel Launches Table Import Wizard Select Tables (sheets) Data Preview Text File Imports Single Table No Query option
Importing Data from an SSAS Cube SSAS 2005 or greater MDX Query (Designer Available) Result is Flattened to Table
Importing Data from a Data Feed XML Data Streams Online Data Source B to B EDI Data Feed in Atom Format Use Table Import Wizard Provide Web Address
Demo: Loading Data into a Tabular Model Refer to Lab Notes.
Creating Table Relations Relationship Types Active and Inactive Auto Relationship Detection Verifying Auto Detection Manually Defining Relationships Data Types Concatenated Key Relationships
Logical vs. Physical Model Renaming Tables and Fields Hiding Rows Denormalizing After Loading Data Using the Related Function Denormalizing While Loading Data Using SQL Queries
Hierarchies Organize Attributes Natural Hierarchies Year Quarter Month Country Region City Aids in Rolling up/Drilling down Analysis
Demo: Updating a Data Model
Adding Calculated Columns Data Types Whole Number Decimal Number Currency True/False Text Date Binary Uses DAX Expressions Populated When Defined
DAX Syntax =[Margin]/[TotalCost] =[FirstName] & " " & [LastName] ="Week" & "-" & Right([CalendarWeek],2) =FORMAT('Date'[Datekey],"dddd mmm-dd") =Year(NOW()) - Year([BirthDate]) =MONTH([Datekey]) =IF([SellingAreaSize]>=1000,"Large","Small")
Navigation Functions Getting a Value From a Related Table Getting a Set of Values From a Related Table Filtering Values from a Related Table =Related('ProductCategory'[ProductCategoryName]) =COUNTX(RELATEDTABLE(Store),Store[EntityKey])
Measures Named Formulas Defined in Measures Grid Used in Values Area of PivotTable Evaluated on the Fly Evaluated Separately for Each Cell Depends on filtering
Aggregation Aggregating a column Aggregating Expressions Over Rows SUM, AVERAGE, COUNT, DISTINCTCOUNT, MIN, MAX Aggregating Expressions Over Rows SUMX, AVERAGEX, COUNTX, MINX, MAXX TotalSales:=SUM([SalesAmount]) TotalMargin:=SUMX(Sales,([SalesAmount]-[TotalCost]))
Filter Context Row and Column Headers Slicers and Filters DAX Formula Filters
Using the Calculate Function Final Result is a single Value Expression is Aggregate SetFilter Modifies Filter Context Boolean Expression Table Expression ResellerSales:=CALCULATE([TotalSales] ,Store[StoreType]="Reseller") AllProductSales:=CALCULATE([TotalSales], ALL(Product))
Demo: Adding Calculations and Measures
Implementing Perspectives Define Viewable Subsets of a Model Provide Business-Specific Viewpoints Select the Viewable Fields and Measures Not Meant to be Used for Security
Applying Role Based Security Define Member Permissions for a Model Membership is by Windows Username/Group Permissions Read Query Data Process Can Run Processing Operations Administrator Can Make Modifications to the Model Schema Can Query All Data
Implementing Row Based Security Row Filters Define Which Rows Can be Queried Row Filters are Defined Using DAX Formulas Must Evaluate to a TRUE/FALSE Value Row Filters Apply to the Specified Rows as Well as Related Rows Use the Filter, =FALSE(), to Deny Access to All Rows For a Table
Creating Partitions Each Table Has One Partition Partitions can Be processed Independently Divide Portions of Data Needing Frequent Processing Use Partition Manager for Selecting Tables, Rows, and Columns for a Partition
Deploying a Tabular Model Must Deploy to SSAS for Client Access Connecting to Deployed Model .bism Connection File in Sharepoint Data connection directly from reporting client Microsoft Excel, Power View, Custom Applications Deployment Options SQL Server Data Tools (SSDT) Set Deployment Properties Server, Database, Cube Name, Processing Analysis Management Objects (AMO) Automation Synchronize Database Wizard
Demo: Partitioning and Securing a Tabular Model