Many-To-Many in DAX Alberto Ferrari Senior Consultant SQLBI DBI413.

Slides:



Advertisements
Similar presentations
The 12 Reasons to Love Microsoft SQL Server 2012 Dandy Weyn Thomas LaRock Sean Boon DBI202_R.
Advertisements

Tips and Tricks for Building Rich Reports in SQL Server 2012 Reporting Services Bob Meyers Senior Program Manager Microsoft Corporation DBI307.
Microsoft Exchange Server 2010 SP2 Tips & Tricks Scott Schnoll Principal Technical Writer Microsoft Corporation EXL305_R.
Kevin Donovan Program Manager, Office BI Microsoft Corporation
Upgrading SSIS Packages to SQL Server 2012 Sven Aelterman Lecturer in Information Systems & Web/Technology Specialist Troy University, Sorrell College.
WSV304 Manual Deployment High cost Fully Automated Low cost.
What's New in Microsoft Deployment Toolkit 2012 Michael Niehaus Senior Program Manager Microsoft Corporation.
Working on an Agile Team with Visual Studio 2012 and Team Foundation Server 2012 Peter Provost Sr. Program Manager Lead Microsoft Corporation DEV318.
Sqlbi.com. sqlbi.com When Many To Many Are Really Too Many Alberto Ferrari Senior Consultant SQLBI.COM.
Defense Against the Dark Ages: Your Old Web Apps Are Trying to Kill You Aaron Margosis Principal Consultant Microsoft Corporation SIA324.
Deploying Windows 8 with MDT: A Preview Michael Niehaus Senior Program Manager Microsoft Corporation.
Troubleshooting Windows 7 Deployments Michael Niehaus Senior Program Manager Microsoft Corporation.
Five Infrastructure Changes That Will Boost Performance for the Windows Client Andreas Stenhall Senior Executive Consultant Knowledge Factory.
Windows Azure SQL Reporting Dany Hoter Senior Program Manager Microsoft Corporation Ola Lavi Software Development Engineer Microsoft Corporation.
Self Assessment COS202 a-Expense.
Sysinternals Primer: Gems Aaron Margosis Principal Consultant Microsoft Corporation SIA311.
Customizing the User State Migration Tool Michael Niehaus Senior Program Manager Microsoft Corporation WCL322.
Building the Fastest SQL Servers Brent Ozar Microsoft Certified Solutions Master (MCSM) Brent Ozar PLF, LLC DBI328.
Data Mining 2012 with Microsoft Excel 2010 and PowerPivot Mark Tabladillo, Ph.D. Microsoft MVP, Data Mining Architect MarkTab Consulting DBI204.
Exploring SQL Server Data Tier Applications Gert Drapers Principal Group Program Manager Microsoft Corporation Adam Mahood Program Manager.
Enterprise Information Management (EIM): Bringing Together SSIS, DQS, and MDS Matt Masson Senior Program Manager Microsoft Corporation Matthew Roche Senior.
The Busy Developer’s Guide to Virtualization Brian A. Randell Senior Consultant MCW Technologies AAP301.
Identify & Fix Performance Problems with Visual Studio 2012 Ultimate Benjamin Day Benjamin Day Consulting, Inc. benday.com/blog
Delivering KPIs with Microsoft SQL Server Analysis Services
SQL Azure Administration and Application Self-Servicing Michal Lesiczka Program Manager Microsoft Corporation Vinod Jagannathan Program Manager Microsoft.
4/19/2017 7:47 PM DBI311 Microsoft SQL Server Data Tools: Database Development from Zero to Sixty Gert Drapers Principal Group Program Manager.
Configuring Kerberos for Microsoft SharePoint 2010 BI in 7 Steps (SQL Server 2012) Chuck Heinzelman Senior Program Manager – BPD CX Microsoft Corporation.
App Compat for Nerds: Understanding, Troubleshooting, and Fixing Busted Apps chris jackson principal consultant microsoft corporation WCL402.
Optimizing Microsoft SQL Server Analysis Services for Big Data Adam Jorgensen Microsoft Corporation.
Exploring SQL Server Data Tier Applications Bob Beauchemin Developer Skills Partner SQLskills DBI309.
The Dirty Dozen: Windows PowerShell Scripts for the Busy DBA Ike Ellis.
DBI329. video.
Real World High Availability and Site Resilience Design Robert Gillies Solution Architect Microsoft Corporation EXL308.
Optimizing Your BI Semantic Model for Performance and Scale Dave Wickert (AE7TD) Principal Program Manager SQL Server Business Intelligence.
BISM: Multidimensional vs. Tabular Marco Russo Senior Consultant SQLBI.
ASP.NET for Mobile and Tablet Development Damian Edwards Senior Program Manager Microsoft Corporation.
Building Self-Service BI Applications Using PowerPivot Julie Strauss Senior Program Manager Lead Microsoft Corporation DBI301.
Tips and Tricks: Effectively Manage Your SharePoint Farm with BI Kevin Donovan Program Manager Microsoft Corporation DBI306.
WCL328 - Windows Intune for the Enterprise David Nudelman Senior Consultant – Microsoft MVP OCSL - UK.
App Controller Tabrez Mohammed Yuan Zheng Program Managers Microsoft Corporation MGT303.
Microsoft SQL Server Data Tools: Database Development from Zero to Sixty Gert Drapers Principal Group Program Manager Microsoft Corporation.
Cloud-Ready Data Services. cloud data services.
Building the Fastest SQL Servers Brent Ozar Microsoft Certified Solutions Master (MCSM) Brent Ozar PLF, LLC DBI328.
Advanced Microsoft SharePoint 2010 Upgrade Troubleshooting Shane Young – Todd Klindt SharePoint Nerds Rackspace OSP339.
BISM Introduction Marco Russo
Integrating SQL Server FileTables, Property Search, and FTS/Semantic Search Bob Beauchemin Developer Skills Partner SQLskills.
Demystifying Forefront Edge Security Technologies – TMG and UAG Richard Hicks Director – Sales Engineering Celestix Networks, Inc. SIA208.
Going Beyond F11: Debug Better and Faster with Visual Studio 2012 Brian A. Randell Senior Consultant MCW Technologies DEV317.
App Deployment Options for Windows AZR205.
Julie Strauss Senior Program Manager Lead Microsoft Corporation
Running Reporting Services in SharePoint Integrated Mode: How and Why
6/19/2018 © 2014 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks.
Matt Masson Senior Program Manager Microsoft Corporation
9/23/2018 1:04 AM © 2009 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)
Building the Perfect BI Semantic Model for Power View
11/16/ :06 AM © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
TechEd /19/ :10 AM © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered.
TechEd /24/2018 6:19 AM © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered.
TechEd /3/2018 7:58 PM © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks.
TechEd /4/2018 3:19 AM © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks.
The Dirty Dozen: Windows PowerShell Scripts for the Busy DBA
TechEd /11/ :54 PM © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered.
TechEd /18/2019 2:43 PM © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks.
Pushing Data to and from the Cloud with SQL Azure Data Sync
Building the Perfect BI Semantic Model for Power View
TechEd /10/2019 8:11 AM © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks.
TechEd /11/ :25 AM © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered.
Enriching your BI Semantic Models with Data Analysis Expressions (DAX)
Running Reporting Services in SharePoint Integrated Mode: How and Why
Presentation transcript:

Many-To-Many in DAX Alberto Ferrari Senior Consultant SQLBI DBI413

Alberto Ferrari

Classical M2M We will start looking at the final result Then, we dive into the DAX code Demo – Classical M2M

Filter on Dim_CustomerFilter on Dim_Account

This filter is applied by the Tabular data model

FILTER: For each row in Dim_Account CALCULATE: filters the bridge

This filter is applied by the Tabular data model FILTER: For each row in Dim_Account CALCULATE: filters the bridge Only rows in Dim_Account where COUNTROWS () > 0 survive the FILTER

This filter is applied by the Tabular data model FILTER: For each row in Dim_Account CALCULATE: filters the bridge Only rows in Dim_Account where COUNTROWS () > 0 survive the FILTER SUM is evaluated only for the accounts filtered from the customers

AmountM2M_Correct := CALCULATE ( SUM (Fact_Transaction[Amount]), FILTER ( Dim_Account, CALCULATE ( COUNTROWS (Bridge_AccountCustomer) ) > 0 ) )

All the rows in the Account table survived the FILTER

Two rows in the Account table survived the FILTER

AmountM2M_Correct := CALCULATE ( SUM (Fact_Transaction[Amount]), FILTER ( Dim_Account, CALCULATE ( COUNTROWS (Bridge_AccountCustomer) ) > 0 ) )

The context is moved in a single Vertipaq operation

Cascading M2M Many-to-many with more than one bridge table Cascading many-to-many

Filter on Dim_CategoryFilter on Dim_Account The pattern is the same, but this time we need to jump two steps to complete our task

CALCULATE( SUM( Fact_Transaction[Amount] ), CALCULATETABLE ( SUMMARIZE ( BridgeAccountCustomer, DimAccount[ID_Account] ), SUMMARIZE ( Bridge_CustomerCategory, DimCustomer[ID_Customer] ) ) )

Need for some ETL here The bridge now «feels» three different filters, but the formula becomes a classical many to many and runs faster

Survey A first example of the usage of the many-to-many pattern Using M2M on Surveys

Question1 = «Job» Answer1 = «Consultant» Question2 = «Yearly Income»

Additional conditions to set the relationships with two tables in DAX only

Basket Analysis A pretty complex scenario, solved with the many-to-many pattern Basket Analysis Demo

This is the fact table… Do you really like to self-join it?

We can filter «Mountain Tire Tube» with this table but… where do we filter «Mountain Bike»?

2° filter: «Mountain Bike» 1° filter: «Mountain Tire Tube»

1° filter: «Mountain Bike» 2° filter: «Mountain Tire Tube» HavingProduct = Bought Both NotHavingProduct = Bought Bike, No Tire

Inactive Relationships

1° M2M Pattern 2° M2M Pattern

Querying M2M Well… what about performance of m2m in Tabular? Let us see them! M2M Performance

2,700, , ,440 9,000 4,000,000,000

DBI305 Developing and Managing a BI Semantic Model in Analysis Services DBI413 Many-to-Many Relationships in BISM Tabular DBI319 BISM: Multidimensional vs. Tabular DBI62-HOL Optimizing a MS SQL Server 2012 Tabular BI Semantic Model Book Signing at Book Store on Wednesday, June 13 th, 12:30pm-1:00pm

mva Microsoft Virtual Academy SQL Server 2012 Eval Copy Get Certified! Hands-On Labs

Connect. Share. Discuss. Learning Microsoft Certification & Training Resources TechNet Resources for IT Professionals Resources for Developers

Required Slide Complete an evaluation on CommNet and enter to win!

Scan the Tag to evaluate this session now on myTechEd Mobile Required Slide *delete this box when your slide is finalized Your MS Tag will be inserted here during the final scrub.