Modeling scenarios for DAX

Slides:



Advertisements
Similar presentations
04 | Building Stellar Data Visualizations Using Power View.
Advertisements

MS Access: Database Concepts Instructor: Vicki Weidler.
April 10-12, Chicago, IL Drab to Dynamite! Managed Self-Service BI Using Real-World Data Riccardo Muti, Sandy Rivas.
Realizing Business Insights with PowerPivot
SPONSORS. Microsoft PowerPivot for SQL Server, Excel 2010, and SharePoint 2010 Michael Herman Syntergy, Inc.
OFC304 Excel 2003 Overview: XML Support Joseph Chirilov Program Manager.
Objects for Business Reporting MIS 497. Objective Learn about miscellaneous objects required for business reporting. Learn about miscellaneous objects.
The Last Mile: Delivering the Facts – Client Side Analysis.
An Internet of Things: People, Processes, and Products in the Spotfire Cloud Library Dr. Brand Niemann Director and Senior Data Scientist/Data Journalist.
David Dye.  Introduction  Introduction to PowerPivot  Working With PowerPivot.
BI Terminologies.
Highline Class, BI 348 Basic Business Analytics using Excel Introduction to PowerPivot 1.
Advanced Tips And Tricks For Power Query
Best practices for Power BI Julian Wissel Hans Fousert.
SQL Server Analysis Services Understanding Unified Dimension Model (UDM)
Intro to Power BI Azhagappan Arunachalam.  Senior Database Architect   PowerBICentral.com  (blog on getting started.
BISM Introduction Marco Russo
Power View Overview April 25, POWER VIEW Presentation ready visualizations for the masses.
Write DAX Queries using DAX Studio Alex Barbeau
A highway through the mountains of data with the SQL Server Tabular Model This presentation is a walk through in-memory database and reporting features.
Or How I Learned to Love the Cube…. Alexander P. Nykolaiszyn BLOG:
Example Materials Power BI Desktop File (4/16): 6WPbWY5UTRhaHYwdDA/view?usp=sharing.
Getting Started with Tabular July 11, Phillip Labry  Sr. BI Engineer  IT development for over 25 years  Developer, DBA, Business Intelligence.
about me – Austin Senseman, CFA 5 years in Financial Services, Managed analytics for sales, marketing, risk, finance, &
John Tran Business Program Manager, The Suddath Companies
Victoria Power BI User Group Meeting
Just Enough Database Theory for Power Pivot / Power BI
SQL Server Analysis Services Fundamentals
Building Tabular Models
An (Advanced) Introduction to DAX
Let’s Build a Tabular Model in Azure
Operation Data Analysis Hints and Guidelines
Power BI Performance Tips & Tricks
Relationship modeling patterns in SSAS and Power bi
Chelsea Dohemann Class will start at approximately 8:10am PowerPivot Chelsea Dohemann
6/16/2018 © 2014 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks.
An (Advanced) Introduction to DAX
Dynamic SQL: Writing Efficient Queries on the Fly
Solving the Hard Problems
Cross UG Summit EMEA /6/2018 7:24 PM
Your friends / colleagues can watch this session Live on !
Module 11: Introduction to DAX Module 11 Introduction to DAX
Introduction to SQL Server Analysis Services
Boosting SSAS Productivity with Tabular Editor
Budgeting with Power Pivot
SQL Server Analysis Services Fundamentals
Linda Nguyen, John Swinehart, Yiwen (Cathy) Sun, Nargiza Nosirova
REPORT QUERY BUILDER featuring: Report Query Viewer.
Best practice using Power pivot. Henk Vlootman, Excel MVP
“5 Minutes to WOW”, but HOW?
SQL Saturday New York City May 19th, 2018
Dynamic SQL: Writing Efficient Queries on the Fly
Evaluation Context Concepts and Examples.
Unlock the Power of PivotTables
Data Modeling and Prototyping
Building your First Cube with SSAS
Power BI – Exploring New Frontiers
Introduction to DAX Mike Davis, Consultant Architect.
Become a Power BI Superstar under 1 hour!
Navigating Your GP Data
Introducing DAX July 11th, 2015.
Let’s Build a Tabular Model in Azure
Enriching your BI Semantic Models with Data Analysis Expressions (DAX)
SQL Server Query Design and Optimization Recommendations
Dashboard in an Hour Using Power BI
Role Playing Dimensions in Tabular Data Models
Learning DAX? Five things to get you started fast
Become a Power BI Superstar under 1 hour!
Dax for most data professionals
Data Modeling and Prototyping
Presentation transcript:

Modeling scenarios for DAX Ana María Bisbé York Business Intelligence Consultant MS Partner on Power BI anabisbe@amby.net http://amby.net/ @ambynet Modeling scenarios for DAX

Thanks to all Sponsors

Say thanks to our volunteers They spend their FREE time to give you this event. Because they are crazy.  Because they want YOU to learn from the BEST IN THE WORLD. João Sarmento Eduardo Piairo Diamantino Falcão

Agenda Intro Decisions to take: Evaluation context Implicit vs Explicit Measures Calculated columns vs measures Measures vs Variables Calculated columns vs Calculated Tables Calculated columns vs Measures vs Context transition Evaluation context Definition Test the quality of data Modify current filter context

DAX - Introduction DAX – Data Analysis Expressions Tabular models Power Pivot SQL Server Analysis Services Tabular Power BI Functional language Execution flows as function calls From inner to outer most Single line execution

Is it easy to write DAX expressions?

Demo !!! 

Is it easy to write DAX expressions?

Decisions to take !!

Calculated column vs Measures Design of the model Calculated column, (preferably during the Query step) Headers of rows and/or columns of a table or matrix, discrete axis in charts or slicers Measures (with DAX) Examine the result as value, in the central panel of the pivot table Use this value as data source for the KPI Value depends on the user-defined context Affected by table filters, charts and slicers

Explicit measures vs Columns Implicit measures are created when a numeric column is selected. The default aggregate function is Sum Good practices: Create the measure It’s easier to read and to maintain the code From them on, we can always select the Total Quantity measure. We do not need the table name to refer to the measure, the measures belong to the model. Explicit measures are wrapped in a CALCULATE, although we don’t write it CALCULATE creates the transition from the row context into filter context. This avoids the use of navigation functions, which once again improves reading and maintenance. When exporting the model to Excel, the measures are available for the ”pivot table values”, numeric columns, in the other hand, are not.

Calculated columns vs measures Two types of calculations in DAX Calculated columns It is evaluated row by row It consumes more resources, calculates for every row of the column Immediate calculation and storage in column of the tabular model Useful for filters and segmentation. Best Practices: Creating calculated columns in a query. Do not create calculated columns for numeric values Measures It is evaluated by using on a table/chart It consumes less resources, only calculated for active elements. Dynamic calculation, on the fly Written always in DAX, same syntax, different context

Calculated columns vs measures Calculations from columns Calculations from measures

Measures vs Variables Variables More readable code Less evaluation for each function No additional measure is created

Model types Unique table Snowflake Star Excel classic, before Excel 2013 Snowflake Normalized There are links between the search tables or directly to the facts tables. Star Denormalized model All search tables (dimensions) point directly to the facts table

Relationships between tables and DAX Combined filters from different tables All tables are pointing to Facts Tables

Relationships between tables and DAX Crossfilter direction Single direction in the model  Need to filter in both directions  Both directions in the calculation or in the model?

Relationships between tables and DAX Crossed filter direction: bidirectional The filter from Products propagates to Sales(1:M) The filter propagates from Sales to Customers(M:1) Caution – could be very dangerous 

Relationships between tables and DAX Crossfilter direction Single direction in the model Both directions in the calculation !! DAX to the rescue !!!

Calculated columns vs Calculated tables Table with a single column Calculated column

Calculated columns vs Calculated tables Tables created with columns, single DAX expression

Evaluation context

DAX Contexts Different results of a measure, depending on context The result depends on: The code The filter context in which is evaluated

Testing context with FILTER Given a context Create a temporary table to test the value Calculate the aggregated in a measurement

Testing context with FILTER Given a context Calculate the aggregated of a measure, using directly the filter expression

Modifying context with DAX Replace the existing FILTER context With functions CALCULATE or CALCULATETABLE Ignore existing context With function ALL

Modifying context with DAX Replace or Ignore existing context Only when it corresponds Analysis done by category Nothing to replace or ignore ignorar

Modifying context with DAX Contexts and comparisons Compare in a single category Exclude total value

Modifying context with DAX – April 2017 Quick measures – (preview versión)

Modifying context with DAX – Abril 2017 Surprise! Power BI Desktop writes DAX  Quick measures

Resources Books Tools

DAX - Recap It is easy to start writing DAX expressions for tabular models Very powerful, and delicate at the same time Measures and CALCULATE are our best allies #HappyDAXing 

Questions? Ana María Bisbé York anabisbe@amby.net http://amby.net/ @ambynet Thanks!!! #sqlsatPorto #sqlsat685