Introduction to Tabular Data Models

Slides:



Advertisements
Similar presentations
Chapter 4 Joining Multiple Tables
Advertisements

Ashley Ohmann June 20, * What is Custom SQL? * What can I do with it? * Join conditions * Unions and Self Joins * Ranks * Derived Tables.
Concepts of Database Management Sixth Edition
Concepts of Database Management Seventh Edition
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 8 Advanced SQL.
A Guide to SQL, Seventh Edition. Objectives Retrieve data from a database using SQL commands Use compound conditions Use computed columns Use the SQL.
02 | Advanced SELECT Statements Brian Alderman | MCT, CEO / Founder of MicroTechPoint Tobias Ternstrom | Microsoft SQL Server Program Manager.
Rationale Aspiring Database Developers should be able to efficiently query and maintain databases. This module will help students learn the Structured.
Introduction –All information systems create, read, update and delete data. This data is stored in files and databases. Files are collections of similar.
Chapter 3 Single-Table Queries
Introduction to Databases Chapter 7: Data Access and Manipulation.
Chapter 9 Joining Data from Multiple Tables
Using SAS® Information Map Studio
Concepts of Database Management Seventh Edition
Introduction to SQL Server JOINS © Meganadha Reddy K., Meganadha Reddy K. Technical Trainer | NetCom Learning
Chapter 4Introduction to Oracle9i: SQL1 Chapter 4 Joining Multiple Tables.
Copyright 2008 McGraw-Hill Ryerson 1 TECHNOLOGY PLUG-IN T7 PROBLEM SOLVING USING ACCESS.
Intro to SQL Management Studio. Please Be Sure!! Make sure that your access is read only. If it isn’t, you have the potential to change data within your.
Programming in R SQL in R. Running SQL in R In this session I will show you how to: Run basic SQL commands within R.
1 2 3 The result is ALL Sales Territory Country.
Structured Query Language Introduction. Basic Select SELECT lname, fname, phone FROM employees; Employees Table LNAMEFNAMEPHONE JonesMark SmithSara
AL-MAAREFA COLLEGE FOR SCIENCE AND TECHNOLOGY INFO 232: DATABASE SYSTEMS CHAPTER 7 (Part II) INTRODUCTION TO STRUCTURED QUERY LANGUAGE (SQL) Instructor.
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.
Sales Dim Date Dim Customers Dim Products Dim Categories Dim Geography The data warehouse is a simple and standard one, after all we.
1 2 Concepts of Database Management, 4 th Edition, Pratt & Adamski Chapter 2 The Relational Model 1: Introduction, QBE, and Relational Algebra.
ORDER BY clause in SELECT command: Normally, the result of the query will not be in ordered format. If we want to get the result of the query in specific.
A Guide to SQL, Eighth Edition Chapter Four Single-Table Queries.
Query Processing – Implementing Set Operations and Joins Chap. 19.
BISM Introduction Marco Russo
Write DAX Queries using DAX Studio Alex Barbeau
Or How I Learned to Love the Cube…. Alexander P. Nykolaiszyn BLOG:
1 ORACLE I 3 – SQL 1 Salim Phone: YM: talim_bansal.
IFS180 Intro. to Data Management Chapter 10 - Unions.
Chapter 12 Introducing Databases. Objectives What a database is and which databases are typically used with ASP.NET pages What SQL is, how it looks, and.
Taking Analysis Services Tabular to Enterprise Levels Stacia Varga Data Inspirations
Overview Microsoft Information Management
Review DirectQuery in SSAS 2016, best practices and use cases
SQL Server Analysis Services Fundamentals
Building Tabular Models
Introduction to Tabular Data Models
Power BI Performance Tips & Tricks
Connect to SQL Server and run select statements
02 | Advanced SELECT Statements
6/12/2018 2:19 PM BRK3245 DirectQuery in Analysis Services: best practices, performance, and use cases Marco Russo SQLBI © Microsoft Corporation. All rights.
6/16/2018 © 2014 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks.
Implementing Data Models & Reports with Microsoft SQL Server
Cross UG Summit EMEA /6/2018 7:24 PM
Module 11: Introduction to DAX Module 11 Introduction to DAX
03 | Querying Multiple Tables with Joins
Toolkit for DAX Optimization
Introduction to tabular models
Introduction to tabular models
SQL Server Analysis Services Fundamentals
SQL Server Analysis Services Fundamentals
Enriching your BI Semantic Models with Data Analysis Expressions (DAX)
DAX and the tabular model
Enhance BI Applications and Simplify Development
SQL Saturday New York City May 19th, 2018
Chapter 4 Summary Query.
Modeling scenarios for DAX
Database systems Lecture 3 – SQL + CRUD
Access: SQL Participation Project
SQL Fundamentals in Three Hours
Processing Analysis Services Tabular Models
Data Analysis with SQL Window Functions
Power BI with Analysis Services
Navigating Your GP Data
Introducing DAX July 11th, 2015.
Enriching your BI Semantic Models with Data Analysis Expressions (DAX)
Module 8: Introduction to MDX Module 8 Introduction to MDX
Presentation transcript:

Introduction to Tabular Data Models Julie Koesmarno | Consultant, MsSQLGirl Patrick LeBlanc | Senior Technical Specialist, Microsoft

04 | Querying with DAX Julie Koesmarno | Consultant, MsSQLGirl Patrick LeBlanc | Senior Technical Specialist, Microsoft

Module Overview Introduction To DAX Syntax Writing DAX Queries Outside SSMS Using DAX Queries In Practical World

Introduction To DAX Syntax

Querying With DAX Usage Syntax / Functions EVALUATE SUMMARIZE TopN Many others to look into, e.g. ADDCOLUMN GENERATEALL CALCULATETABLE Tools to use DAX Editor DAX Studio When this would be useful Actions SSRS Report

DAX in SSMS: Evaluate DAX in DAX Editor: Summarize

EVALUATE [DEFINE {MEASURE <tableName>[<name>] = <expression>} EVALUATE <table> [ORDER BY {<expression> [{ASC | DESC}]}[, …] [START AT {<value>|<parameter>} [, …]]] Retrieve data from table expression. T-SQL Equivalent SELECT * FROM <table> Note Formatting configured in Tabular Model is lost

EVALUATE is similar to EVALUATE 'InternetSales' SELECT * FROM [dbo].[FactInternetSales] EVALUATE 'InternetSales'

EVALUATE

SUMMARIZE SUMMARIZE(<table>, <groupBy_columnName>[, <groupBy_columnName>]…[, <name>, <expression>]…) Returns requested aggregated values over a set of groups T-SQL Equivalent SELECT <columns>, <aggregated columns> FROM <table> GROUP BY <columns> Type Statistical Function

SUMMARIZE is similar to … EVALUATE SUMMARIZE (     'InternetSales',     'Product'[Product Name],     "Sales", SUM ( 'InternetSales'[Sales Amount] ),     "Revenue", 'InternetSales'[Revenue] )

SUMMARIZE SELECT p.[EnglishProductName], SUM(f.[SalesAmount]) AS Sales, SUM(f.[SalesAmount] - f.[ProductStandardCost] - f.[Freight] - f.[TaxAmt]) AS Revenue FROM [dbo].[FactInternetSales] f INNER JOIN [dbo].[DimProduct] p ON p.[ProductKey] = f.[ProductKey] GROUP BY p.[EnglishProductName];

SUMMARIZE

TopN TOPN(<n_value>, <table>, <orderBy_expression>, [<order>[, <orderBy_expression>, [<order>]]…]) Returns a table with the Cartesian product between each row in table1 and the table that results from evaluating table2 in the context of the current row from table1. T-SQL Equivalent SELECT <columns> FROM <table1> LEFT OUTER JOIN <table2> Type Filter Function

TopN EVALUATE FILTER (     GENERATE (         VALUES ( 'Date'[Calendar Year] ),         ADDCOLUMNS (             TOPN (                 10,                 VALUES ( 'Product'[Product Name] ),                 'InternetSales'[Sum of Sales],                 0             ),             "Sales", 'InternetSales'[Sum of Sales]         )     ),     'InternetSales'[Sum of Sales] > 0 ) ORDER BY 'Date'[Calendar Year], "Sales" DESC

TopN – SQL Equivalent SELECT DISTINCT d.[CalendarYear], s.[EnglishProductName], s.[Sales] FROM [dbo].[DimDate] d OUTER APPLY (SELECT TOP 10 p.[EnglishProductName], SUM(sx.[SalesAmount]) Sales FROM [dbo].[FactInternetSales] sx INNER JOIN [dbo].[DimDate] dx ON dx.[DateKey] = sx.[OrderDateKey] INNER JOIN [dbo].[DimProduct] p ON p.[ProductKey] = sx.[ProductKey] WHERE d.[CalendarYear] = dx.[CalendarYear] GROUP BY dx.[CalendarYear], p.[EnglishProductName] ORDER BY SUM(sx.[SalesAmount]) DESC ) s WHERE s.[Sales] > 0 d.[CalendarYear] ASC, s.[Sales] DESC

Writing DAX Queries Outside SSMS

DAX in DAX Studio: TopN

Tools To Use Add-In To Excel Add-In To VS 2010, 2012 DAX Editor

Using DAX Queries In Practical World

Creating custom DAX query for Action

DAX in Reporting Tools Create a Report Project Change Command Type to DMX to write a DAX query Can also write MDX query as per normal SSAS

Alternative for SSRS If using In-Memory model, can use MDX on SSRS

Querying with DAX Session Takeaways Ability to write simple DAX Query Know what tools to use to write DAX Query Using DAX Queries to inspect data in DAX Studio Embedding DAX Queries into Action Using DAX Query in SSRS