SlideShare uma empresa Scribd logo
1 de 22
Introduction to Data Analysis
      Expressions (DAX)


                  Alan Koo
      President & Founder | Puerto Rico PASS
          Senior Consultant | Nagnoi, Inc.
Analysis Services 2012 Flavors
       • Personal BI: PowerPivot for Excel 2010
       • Team BI: PowerPivot for Sharepoint
       • Corporate BI (SSDT):
                – Analysis Services 2012 Tabular
                – Analysis Services 2012 Multidimensional



Tasting the Flavors of SSAS 2012 | SQL Saturday Puerto Rico | Alan Koo | www.alankoo.com
What is DAX
• Programming language of SSAS 2012 Tabular and
  PowerPivot
• Simple, clean, powerful, fast, not easy
• Tabular requires simpler data modeling for good result
• Thinking in DAX is a new attitude
BI Semantic Model: The Analysis Services 2012 Foundation
  From Personal to Corporate BI




                                                             DAX                           MDX

Tasting the Flavors of SSAS 2012 | SQL Saturday Puerto Rico | Alan Koo | www.alankoo.com
Sample Data - Contoso
Building Models in
    PowerPivot
& Analysis Services
  Tabular Mode


              A quick refresh
Data Analysis Expressions (DAX)
Calculated Columns and Measures
• Calculated Columns
  – Columns in the database, calculated with DAX
  – Stored in the database
• Measures
  – DAX formulas computed on aggregates of values
  – Computed at query time
• Different usages for different modeling needs
Calculated Columns

• Formula is evaluated for each row
• Results are stored back into PowerPivot as any other
  column
• Columns can be used for both slicing data and
  summarizing values
• Part of the model, available for use in any PivotTable
• Usable by other AS clients in PowerPivot for SharePoint
DAX includes 80 Functions from Excel
Date and Time   Information   Math and Trig           Statistical   Text
 DATE            ISBLANK       ABS                     AVERAGE       CONCATENATE
 DATEVALUE       ISERROR       CEILING, ISO.CEILING    AVERAGEA      EXACT
 DAY             ISLOGICAL     EXP                     COUNT         FIND
 EDATE           ISNONTEXT     FACT                    COUNTA        FIXED
 EOMONTH         ISNUMBER      FLOOR                   COUNTBLANK    LEFT
 HOUR            ISTEXT        INT                     MAX           LEN
 MINUTE                        LN                      MAXA          LOWER
 MONTH          Logical        LOG                     MIN           MID
 NOW             AND           LOG10                   MINA          REPLACE
 SECOND          IF            MOD                                   REPT
 TIME            IFERROR       MROUND                                RIGHT
 TIMEVALUE       NOT           PI                                    SEARCH
 TODAY           OR            POWER                                 SUBSTITUTE
 WEEKDAY         FALSE         QUOTIENT                              TRIM
 WEEKNUM         TRUE          RAND                                  UPPER
 YEAR                          RANDBETWEEN                           VALUE
YEARFRAC                       ROUND
                               ROUNDDOWN
                               ROUNDUP
                               SIGN
                               SQRT
                               SUM
                               SUMSQ
                               TRUNC                                               12
Calculated Measures
• Evaluated dynamically per value in PivotTable

• Part of the model, available to other PivotTables

• Usable by any AS client through PowerPivot for SharePoint




                                                              13
DAX Aggregation Functions
• SUM, AVERAGE, MIN, MAX, COUNT take column references

• Extensions aggregate an expression over the rows of a table
     •   SUMX        (Table, Expression)
     •   AVERAGEX    (Table, Expression)
     •   COUNTAX     (Table, Expression)
     •   MINX        (Table, Expression)
     •   MAXX        (Table, Expression)
     •   COUNTROWS   (Table)

                                                                14
Calculated Columns
        and
Measures (Functions)



                       DAX Demo
Beyond Excel




You Are Here
Time Intelligence




              DAX in Action!
Useful Resources
• Data Analysis Expressions (DAX) Overview – MSDN
  http://msdn.microsoft.com/en-us/library/gg399181.aspx

• DAX in Action! – Alberto Ferrari in Project Botticelli
  ProjectBotticelli.com


• SQLBI.com Articles
  http://www.sqlbi.com/articles/all/


• Microsoft Business Intelligence y más… - Alan Koo
  alankoo.com
Calculated Columns
• Calculated columns
  – Stored in the database, computed at process time
  – On big fact tables can consume a lot of RAM
  – Required to slice data
• Measures
  – Computed at query time, do not use RAM
• Prefer measures, whenever possible
Summary
• DAX is fast: its speed of DAX makes simpler modeling
  techniques shine
• Tabular requires thinking in DAX, less modeling, more
  complex expressions
• PowerPivot is a great prototyping tool, models created in
  Excel can be deployed on SSAS Tabular
Credits for this Session
• Ashvini Sharma – Microsoft Corporation
• Alberto Ferrari and Marco Russo - SQLBI
Questions?
Authorized Training Center




             Designed for professionals who want to use PowerPivot’s full
               capabilities, the PowerPivot Workshop is a two/three-day
               course that covers PowerPivot topics, starting from basic
            concepts and moving on up to complex data models and DAX
             formulas with the goal to facilitate the use of PowerPivot in
                                    the real world.

                               Nestor Figueroa | 787.671.8244
                             powerpivotworkshop@nagnoi.com
Puerto Rico PASS Chapter
         Like us in Facebook! Our next meet is on Nov 29th.




                                                       Subscribe to our newsletter

Mais conteúdo relacionado

Mais procurados

DAX and Power BI Training - 001 Overview
DAX and Power BI Training -  001 OverviewDAX and Power BI Training -  001 Overview
DAX and Power BI Training - 001 OverviewWill Harvey
 
What is Power BI
What is Power BIWhat is Power BI
What is Power BINaseeba P P
 
3D: DBT using Databricks and Delta
3D: DBT using Databricks and Delta3D: DBT using Databricks and Delta
3D: DBT using Databricks and DeltaDatabricks
 
Data visualization
Data visualizationData visualization
Data visualizationHoang Nguyen
 
Intro for Power BI
Intro for Power BIIntro for Power BI
Intro for Power BIMartin X
 
DW Migration Webinar-March 2022.pptx
DW Migration Webinar-March 2022.pptxDW Migration Webinar-March 2022.pptx
DW Migration Webinar-March 2022.pptxDatabricks
 
Data Architecture Best Practices for Advanced Analytics
Data Architecture Best Practices for Advanced AnalyticsData Architecture Best Practices for Advanced Analytics
Data Architecture Best Practices for Advanced AnalyticsDATAVERSITY
 
Data Lakehouse, Data Mesh, and Data Fabric (r1)
Data Lakehouse, Data Mesh, and Data Fabric (r1)Data Lakehouse, Data Mesh, and Data Fabric (r1)
Data Lakehouse, Data Mesh, and Data Fabric (r1)James Serra
 
Power BI Data Modeling.pdf
Power BI Data Modeling.pdfPower BI Data Modeling.pdf
Power BI Data Modeling.pdfVishnuGone
 
OLAP Cubes in Datawarehousing
OLAP Cubes in DatawarehousingOLAP Cubes in Datawarehousing
OLAP Cubes in DatawarehousingPrithwis Mukerjee
 
Improve power bi performance
Improve power bi performanceImprove power bi performance
Improve power bi performanceAnnie Xu
 
Power BI vs Tableau: Which One is Best For Business Intelligence
Power BI vs Tableau: Which One is Best For Business IntelligencePower BI vs Tableau: Which One is Best For Business Intelligence
Power BI vs Tableau: Which One is Best For Business IntelligenceStat Analytica
 
Introduction to NoSQL Databases
Introduction to NoSQL DatabasesIntroduction to NoSQL Databases
Introduction to NoSQL DatabasesDerek Stainer
 

Mais procurados (20)

DAX and Power BI Training - 001 Overview
DAX and Power BI Training -  001 OverviewDAX and Power BI Training -  001 Overview
DAX and Power BI Training - 001 Overview
 
Data Modeling with Power BI
Data Modeling with Power BIData Modeling with Power BI
Data Modeling with Power BI
 
What is Power BI
What is Power BIWhat is Power BI
What is Power BI
 
3D: DBT using Databricks and Delta
3D: DBT using Databricks and Delta3D: DBT using Databricks and Delta
3D: DBT using Databricks and Delta
 
Data visualization
Data visualizationData visualization
Data visualization
 
PowerBI Training
PowerBI Training PowerBI Training
PowerBI Training
 
Intro for Power BI
Intro for Power BIIntro for Power BI
Intro for Power BI
 
Data lake ppt
Data lake pptData lake ppt
Data lake ppt
 
Alteryx Presentation
Alteryx PresentationAlteryx Presentation
Alteryx Presentation
 
DW Migration Webinar-March 2022.pptx
DW Migration Webinar-March 2022.pptxDW Migration Webinar-March 2022.pptx
DW Migration Webinar-March 2022.pptx
 
Data Architecture Best Practices for Advanced Analytics
Data Architecture Best Practices for Advanced AnalyticsData Architecture Best Practices for Advanced Analytics
Data Architecture Best Practices for Advanced Analytics
 
Data Lakehouse, Data Mesh, and Data Fabric (r1)
Data Lakehouse, Data Mesh, and Data Fabric (r1)Data Lakehouse, Data Mesh, and Data Fabric (r1)
Data Lakehouse, Data Mesh, and Data Fabric (r1)
 
Power BI Data Modeling.pdf
Power BI Data Modeling.pdfPower BI Data Modeling.pdf
Power BI Data Modeling.pdf
 
Tableau Prep.pptx
Tableau Prep.pptxTableau Prep.pptx
Tableau Prep.pptx
 
OLAP Cubes in Datawarehousing
OLAP Cubes in DatawarehousingOLAP Cubes in Datawarehousing
OLAP Cubes in Datawarehousing
 
Improve power bi performance
Improve power bi performanceImprove power bi performance
Improve power bi performance
 
Presto
PrestoPresto
Presto
 
Azure SQL Data Warehouse
Azure SQL Data Warehouse Azure SQL Data Warehouse
Azure SQL Data Warehouse
 
Power BI vs Tableau: Which One is Best For Business Intelligence
Power BI vs Tableau: Which One is Best For Business IntelligencePower BI vs Tableau: Which One is Best For Business Intelligence
Power BI vs Tableau: Which One is Best For Business Intelligence
 
Introduction to NoSQL Databases
Introduction to NoSQL DatabasesIntroduction to NoSQL Databases
Introduction to NoSQL Databases
 

Semelhante a Introduction to DAX - Part 1

AWS November Webinar Series - Advanced Analytics with Amazon Redshift and the...
AWS November Webinar Series - Advanced Analytics with Amazon Redshift and the...AWS November Webinar Series - Advanced Analytics with Amazon Redshift and the...
AWS November Webinar Series - Advanced Analytics with Amazon Redshift and the...Amazon Web Services
 
Cloud Computing ...changes everything
Cloud Computing ...changes everythingCloud Computing ...changes everything
Cloud Computing ...changes everythingLew Tucker
 
Building your first Analysis Services Tabular BI Semantic model with SQL Serv...
Building your first Analysis Services Tabular BI Semantic model with SQL Serv...Building your first Analysis Services Tabular BI Semantic model with SQL Serv...
Building your first Analysis Services Tabular BI Semantic model with SQL Serv...Microsoft TechNet - Belgium and Luxembourg
 
Big Data Analytics in the Cloud with Microsoft Azure
Big Data Analytics in the Cloud with Microsoft AzureBig Data Analytics in the Cloud with Microsoft Azure
Big Data Analytics in the Cloud with Microsoft AzureMark Kromer
 
Streamlio and IoT analytics with Apache Pulsar
Streamlio and IoT analytics with Apache PulsarStreamlio and IoT analytics with Apache Pulsar
Streamlio and IoT analytics with Apache PulsarStreamlio
 
Thing you didn't know you could do in Spark
Thing you didn't know you could do in SparkThing you didn't know you could do in Spark
Thing you didn't know you could do in SparkSnappyData
 
SnappyData Overview Slidedeck for Big Data Bellevue
SnappyData Overview Slidedeck for Big Data Bellevue SnappyData Overview Slidedeck for Big Data Bellevue
SnappyData Overview Slidedeck for Big Data Bellevue SnappyData
 
SnappyData Toronto Meetup Nov 2017
SnappyData Toronto Meetup Nov 2017SnappyData Toronto Meetup Nov 2017
SnappyData Toronto Meetup Nov 2017SnappyData
 
SnappyData at Spark Summit 2017
SnappyData at Spark Summit 2017SnappyData at Spark Summit 2017
SnappyData at Spark Summit 2017Jags Ramnarayan
 
SnappyData, the Spark Database. A unified cluster for streaming, transactions...
SnappyData, the Spark Database. A unified cluster for streaming, transactions...SnappyData, the Spark Database. A unified cluster for streaming, transactions...
SnappyData, the Spark Database. A unified cluster for streaming, transactions...SnappyData
 
A full Machine learning pipeline in Scikit-learn vs in scala-Spark: pros and ...
A full Machine learning pipeline in Scikit-learn vs in scala-Spark: pros and ...A full Machine learning pipeline in Scikit-learn vs in scala-Spark: pros and ...
A full Machine learning pipeline in Scikit-learn vs in scala-Spark: pros and ...Jose Quesada (hiring)
 
Time Series Analytics Azure ADX
Time Series Analytics Azure ADXTime Series Analytics Azure ADX
Time Series Analytics Azure ADXRiccardo Zamana
 
AWS re:Invent 2016: Billions of Rows Transformed in Record Time Using Matilli...
AWS re:Invent 2016: Billions of Rows Transformed in Record Time Using Matilli...AWS re:Invent 2016: Billions of Rows Transformed in Record Time Using Matilli...
AWS re:Invent 2016: Billions of Rows Transformed in Record Time Using Matilli...Amazon Web Services
 
The Challenges of Bringing Machine Learning to the Masses
The Challenges of Bringing Machine Learning to the MassesThe Challenges of Bringing Machine Learning to the Masses
The Challenges of Bringing Machine Learning to the MassesAlice Zheng
 
Low latency high throughput streaming using Apache Apex and Apache Kudu
Low latency high throughput streaming using Apache Apex and Apache KuduLow latency high throughput streaming using Apache Apex and Apache Kudu
Low latency high throughput streaming using Apache Apex and Apache KuduDataWorks Summit
 
An Insider’s Guide to Maximizing Spark SQL Performance
 An Insider’s Guide to Maximizing Spark SQL Performance An Insider’s Guide to Maximizing Spark SQL Performance
An Insider’s Guide to Maximizing Spark SQL PerformanceTakuya UESHIN
 
Intro to SnappyData Webinar
Intro to SnappyData WebinarIntro to SnappyData Webinar
Intro to SnappyData WebinarSnappyData
 
Enterprise Data World 2018 - Building Cloud Self-Service Analytical Solution
Enterprise Data World 2018 - Building Cloud Self-Service Analytical SolutionEnterprise Data World 2018 - Building Cloud Self-Service Analytical Solution
Enterprise Data World 2018 - Building Cloud Self-Service Analytical SolutionDmitry Anoshin
 

Semelhante a Introduction to DAX - Part 1 (20)

AWS November Webinar Series - Advanced Analytics with Amazon Redshift and the...
AWS November Webinar Series - Advanced Analytics with Amazon Redshift and the...AWS November Webinar Series - Advanced Analytics with Amazon Redshift and the...
AWS November Webinar Series - Advanced Analytics with Amazon Redshift and the...
 
Cloud Computing ...changes everything
Cloud Computing ...changes everythingCloud Computing ...changes everything
Cloud Computing ...changes everything
 
Building your first Analysis Services Tabular BI Semantic model with SQL Serv...
Building your first Analysis Services Tabular BI Semantic model with SQL Serv...Building your first Analysis Services Tabular BI Semantic model with SQL Serv...
Building your first Analysis Services Tabular BI Semantic model with SQL Serv...
 
Big Data Analytics in the Cloud with Microsoft Azure
Big Data Analytics in the Cloud with Microsoft AzureBig Data Analytics in the Cloud with Microsoft Azure
Big Data Analytics in the Cloud with Microsoft Azure
 
Streamlio and IoT analytics with Apache Pulsar
Streamlio and IoT analytics with Apache PulsarStreamlio and IoT analytics with Apache Pulsar
Streamlio and IoT analytics with Apache Pulsar
 
Thing you didn't know you could do in Spark
Thing you didn't know you could do in SparkThing you didn't know you could do in Spark
Thing you didn't know you could do in Spark
 
SnappyData Overview Slidedeck for Big Data Bellevue
SnappyData Overview Slidedeck for Big Data Bellevue SnappyData Overview Slidedeck for Big Data Bellevue
SnappyData Overview Slidedeck for Big Data Bellevue
 
SnappyData Toronto Meetup Nov 2017
SnappyData Toronto Meetup Nov 2017SnappyData Toronto Meetup Nov 2017
SnappyData Toronto Meetup Nov 2017
 
SnappyData at Spark Summit 2017
SnappyData at Spark Summit 2017SnappyData at Spark Summit 2017
SnappyData at Spark Summit 2017
 
SnappyData, the Spark Database. A unified cluster for streaming, transactions...
SnappyData, the Spark Database. A unified cluster for streaming, transactions...SnappyData, the Spark Database. A unified cluster for streaming, transactions...
SnappyData, the Spark Database. A unified cluster for streaming, transactions...
 
A full Machine learning pipeline in Scikit-learn vs in scala-Spark: pros and ...
A full Machine learning pipeline in Scikit-learn vs in scala-Spark: pros and ...A full Machine learning pipeline in Scikit-learn vs in scala-Spark: pros and ...
A full Machine learning pipeline in Scikit-learn vs in scala-Spark: pros and ...
 
Time Series Analytics Azure ADX
Time Series Analytics Azure ADXTime Series Analytics Azure ADX
Time Series Analytics Azure ADX
 
AWS re:Invent 2016: Billions of Rows Transformed in Record Time Using Matilli...
AWS re:Invent 2016: Billions of Rows Transformed in Record Time Using Matilli...AWS re:Invent 2016: Billions of Rows Transformed in Record Time Using Matilli...
AWS re:Invent 2016: Billions of Rows Transformed in Record Time Using Matilli...
 
The Challenges of Bringing Machine Learning to the Masses
The Challenges of Bringing Machine Learning to the MassesThe Challenges of Bringing Machine Learning to the Masses
The Challenges of Bringing Machine Learning to the Masses
 
Low latency high throughput streaming using Apache Apex and Apache Kudu
Low latency high throughput streaming using Apache Apex and Apache KuduLow latency high throughput streaming using Apache Apex and Apache Kudu
Low latency high throughput streaming using Apache Apex and Apache Kudu
 
An Insider’s Guide to Maximizing Spark SQL Performance
 An Insider’s Guide to Maximizing Spark SQL Performance An Insider’s Guide to Maximizing Spark SQL Performance
An Insider’s Guide to Maximizing Spark SQL Performance
 
Intro to SnappyData Webinar
Intro to SnappyData WebinarIntro to SnappyData Webinar
Intro to SnappyData Webinar
 
Implementing Real-Time IoT Stream Processing in Azure
Implementing Real-Time IoT Stream Processing in Azure Implementing Real-Time IoT Stream Processing in Azure
Implementing Real-Time IoT Stream Processing in Azure
 
Enterprise Data World 2018 - Building Cloud Self-Service Analytical Solution
Enterprise Data World 2018 - Building Cloud Self-Service Analytical SolutionEnterprise Data World 2018 - Building Cloud Self-Service Analytical Solution
Enterprise Data World 2018 - Building Cloud Self-Service Analytical Solution
 
Spark cep
Spark cepSpark cep
Spark cep
 

Introduction to DAX - Part 1

  • 1. Introduction to Data Analysis Expressions (DAX) Alan Koo President & Founder | Puerto Rico PASS Senior Consultant | Nagnoi, Inc.
  • 2. Analysis Services 2012 Flavors • Personal BI: PowerPivot for Excel 2010 • Team BI: PowerPivot for Sharepoint • Corporate BI (SSDT): – Analysis Services 2012 Tabular – Analysis Services 2012 Multidimensional Tasting the Flavors of SSAS 2012 | SQL Saturday Puerto Rico | Alan Koo | www.alankoo.com
  • 3. What is DAX • Programming language of SSAS 2012 Tabular and PowerPivot • Simple, clean, powerful, fast, not easy • Tabular requires simpler data modeling for good result • Thinking in DAX is a new attitude
  • 4. BI Semantic Model: The Analysis Services 2012 Foundation From Personal to Corporate BI DAX MDX Tasting the Flavors of SSAS 2012 | SQL Saturday Puerto Rico | Alan Koo | www.alankoo.com
  • 5. Sample Data - Contoso
  • 6. Building Models in PowerPivot & Analysis Services Tabular Mode A quick refresh
  • 8. Calculated Columns and Measures • Calculated Columns – Columns in the database, calculated with DAX – Stored in the database • Measures – DAX formulas computed on aggregates of values – Computed at query time • Different usages for different modeling needs
  • 9. Calculated Columns • Formula is evaluated for each row • Results are stored back into PowerPivot as any other column • Columns can be used for both slicing data and summarizing values • Part of the model, available for use in any PivotTable • Usable by other AS clients in PowerPivot for SharePoint
  • 10. DAX includes 80 Functions from Excel Date and Time Information Math and Trig Statistical Text DATE ISBLANK ABS AVERAGE CONCATENATE DATEVALUE ISERROR CEILING, ISO.CEILING AVERAGEA EXACT DAY ISLOGICAL EXP COUNT FIND EDATE ISNONTEXT FACT COUNTA FIXED EOMONTH ISNUMBER FLOOR COUNTBLANK LEFT HOUR ISTEXT INT MAX LEN MINUTE LN MAXA LOWER MONTH Logical LOG MIN MID NOW AND LOG10 MINA REPLACE SECOND IF MOD REPT TIME IFERROR MROUND RIGHT TIMEVALUE NOT PI SEARCH TODAY OR POWER SUBSTITUTE WEEKDAY FALSE QUOTIENT TRIM WEEKNUM TRUE RAND UPPER YEAR RANDBETWEEN VALUE YEARFRAC ROUND ROUNDDOWN ROUNDUP SIGN SQRT SUM SUMSQ TRUNC 12
  • 11. Calculated Measures • Evaluated dynamically per value in PivotTable • Part of the model, available to other PivotTables • Usable by any AS client through PowerPivot for SharePoint 13
  • 12. DAX Aggregation Functions • SUM, AVERAGE, MIN, MAX, COUNT take column references • Extensions aggregate an expression over the rows of a table • SUMX (Table, Expression) • AVERAGEX (Table, Expression) • COUNTAX (Table, Expression) • MINX (Table, Expression) • MAXX (Table, Expression) • COUNTROWS (Table) 14
  • 13. Calculated Columns and Measures (Functions) DAX Demo
  • 15. Time Intelligence DAX in Action!
  • 16. Useful Resources • Data Analysis Expressions (DAX) Overview – MSDN http://msdn.microsoft.com/en-us/library/gg399181.aspx • DAX in Action! – Alberto Ferrari in Project Botticelli ProjectBotticelli.com • SQLBI.com Articles http://www.sqlbi.com/articles/all/ • Microsoft Business Intelligence y más… - Alan Koo alankoo.com
  • 17. Calculated Columns • Calculated columns – Stored in the database, computed at process time – On big fact tables can consume a lot of RAM – Required to slice data • Measures – Computed at query time, do not use RAM • Prefer measures, whenever possible
  • 18. Summary • DAX is fast: its speed of DAX makes simpler modeling techniques shine • Tabular requires thinking in DAX, less modeling, more complex expressions • PowerPivot is a great prototyping tool, models created in Excel can be deployed on SSAS Tabular
  • 19. Credits for this Session • Ashvini Sharma – Microsoft Corporation • Alberto Ferrari and Marco Russo - SQLBI
  • 21. Authorized Training Center Designed for professionals who want to use PowerPivot’s full capabilities, the PowerPivot Workshop is a two/three-day course that covers PowerPivot topics, starting from basic concepts and moving on up to complex data models and DAX formulas with the goal to facilitate the use of PowerPivot in the real world. Nestor Figueroa | 787.671.8244 powerpivotworkshop@nagnoi.com
  • 22. Puerto Rico PASS Chapter Like us in Facebook! Our next meet is on Nov 29th. Subscribe to our newsletter