Hands-On Business Intelligence with DAX
eBook - ePub

Hands-On Business Intelligence with DAX

Discover the intricacies of this powerful query language to gain valuable insights from your data

  1. 402 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

Hands-On Business Intelligence with DAX

Discover the intricacies of this powerful query language to gain valuable insights from your data

About this book

Implement business intelligence (BI), data modeling, and data analytics within Microsoft products such as Power BI, SQL Server, and Excel

Key Features

  • Understand the ins and outs of DAX expressions and querying functions with the help of easy-to-follow examples
  • Manipulate data of varying complexity and optimize BI workflows to extract key insights
  • Create, monitor, and improve the performance of models by writing clean and robust DAX queries

Book Description

Data Analysis Expressions (DAX) is known for its ability to increase efficiency by extracting new information from data that is already present in your model. With this book, you'll learn to use DAX's functionality and flexibility in the BI and data analytics domains.

You'll start by learning the basics of DAX, along with understanding the importance of good data models, and how to write efficient DAX formulas by using variables and formatting styles. You'll then explore how DAX queries work with the help of examples. The book will guide you through optimizing the BI workflow by writing powerful DAX queries. Next, you'll learn to manipulate and load data of varying complexity within Microsoft products such as Power BI, SQL Server, and Excel Power Pivot. You'll then discover how to build and extend your data models to gain additional insights, before covering progressive DAX syntax and functions to understand complex relationships in DAX. Later, you'll focus on important DAX functions, specifically those related to tables, date and time, filtering, and statistics. Finally, you'll delve into advanced topics such as how the formula and storage engines work to optimize queries.

By the end of this book, you'll have gained hands-on experience in employing DAX to enhance your data models by extracting new information and gaining deeper insights.

What you will learn

  • Understand DAX, from the basics through to advanced topics, and learn to build effective data models
  • Write and use DAX functions and expressions with the help of hands-on examples
  • Discover how to handle errors in your DAX code, and avoid unwanted results
  • Load data into a data model using Power BI, Excel Power Pivot, and SSAS Tabular
  • Cover DAX functions such as date, time, and time intelligence using code examples
  • Gain insights into data by using DAX to create new information
  • Understand the DAX VertiPaq engine and how it can help you optimize data models

Who this book is for

This book is for data analysts, business analysts, BI developers, or SQL users who want to make the best use of DAX in the BI and data analytics domain with the help of examples. Some understanding of BI concepts is mandatory to fully understand the concepts covered in the book.

Frequently asked questions

Yes, you can cancel anytime from the Subscription tab in your account settings on the Perlego website. Your subscription will stay active until the end of your current billing period. Learn how to cancel your subscription.
No, books cannot be downloaded as external files, such as PDFs, for use outside of Perlego. However, you can download books within the Perlego app for offline reading on mobile or tablet. Learn more here.
Perlego offers two plans: Essential and Complete
  • Essential is ideal for learners and professionals who enjoy exploring a wide range of subjects. Access the Essential Library with 800,000+ trusted titles and best-sellers across business, personal growth, and the humanities. Includes unlimited reading time and Standard Read Aloud voice.
  • Complete: Perfect for advanced learners and researchers needing full, unrestricted access. Unlock 1.4M+ books across hundreds of subjects, including academic and specialized titles. The Complete Plan also includes advanced features like Premium Read Aloud and Research Assistant.
Both plans are available with monthly, semester, or annual billing cycles.
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, we’ve got you covered! Learn more here.
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Yes! You can use the Perlego app on both iOS or Android devices to read anytime, anywhere — even offline. Perfect for commutes or when you’re on the go.
Please note we cannot support devices running on iOS 13 and Android 7 or earlier. Learn more about using the app.
Yes, you can access Hands-On Business Intelligence with DAX by Ian Horne in PDF and/or ePUB format, as well as other popular books in Computer Science & Business Intelligence. We have over one million books available in our catalogue for you to explore.

Information

Section 1: Introduction to DAX for the BI Pro

This section covers the basics of DAX, along with the importance of good data models and how to write efficient DAX formulas by using variables and good formatting. You will understand how DAX queries work using an example-based approach. You will also learn how to optimize the BI workflow by writing efficient and powerful DAX queries with easy-to-follow explanations and examples:
  • Chapter 1, What Is DAX?
  • Chapter 2, Using DAX Variables and Formatting
  • Chapter 3, Building Data Models
  • Chapter 4, Working with DAX in Power BI, Excel, and SSAS
  • Chapter 5, Getting It into Context

What is DAX?

In this chapter, you will begin your journey to mastering the use of DAX with a brief introduction to the DAX language itself. We'll look at what it is and why, as a Business Intelligence (BI) professional, you need to learn it if you want to unleash the full power of Excel Power Pivot, Analysis Services, or Power BI.
By the end of this chapter, you will be introduced to the different groups of functions and operators available and the differences between calculated columns and measures, and you will have started your understanding of evaluation contexts. This chapter will round off with a look at how you can alter how filters affect measures by using one of the most important DAX functions, the CALCULATE function.
This chapter is broken down into the following sections:
  • Introducing DAX
  • Working with data types and operators
  • Working with calculated columns and measures
  • Evaluation contexts – part 1
  • Using the CALCULATE function

Introducing DAX

DAX, or Data Analysis Expressions to give it its full name, is a collection of constants, operators, and functions that are used to build expressions that return one or more values. It was originally developed by the SQL Server Analysis Services team as part of their Project Gemini, the development of a new in-memory database technology that would let Excel users work with massive amounts of data. It was introduced initially in 2009 as an add-in to Microsoft Excel 2010 and eventually went on to become the Power Pivot add-in for Excel that we have today.
Today, DAX consists of more than 250 functions, and regularly receives updates to existing functions as well as receiving new functions. It is a language used by the following products in Microsoft's business intelligence stack:
  • Excel Power Pivot
  • Power BI
  • SQL Server Analysis Services (SSAS) Tabular
  • Azure Analysis Services
DAX is not a programming language in the traditional sense but is instead a functional language, which means that it makes calls to a function as part of an expression. The result of an expression will, depending on the function, return either a single value or a table as output. The output from an expression can be used to nest functions, by using it as the input parameter to another function.
DAX can only be used to filter or query a physical table; it cannot add, delete, or update data in a table. However, if you are using Power BI or SSAS Tabular, it can use the result of a DAX expression to add a new table to a data model. Unfortunately, this method cannot be used to add tables to an Excel Power Pivot data model without using a workaround, which itself has limitations.
As Power Pivot was originally built as an add-in to Excel, many of the DAX functions are very similar to functions in Excel, which creates a level of familiarity for BI professionals who are already using Excel.
In Table 1-1, you will see that while some functions are almost identical in syntax, others are not. In Excel, the AND function can compare up to 255 logical conditions, while the equivalent function in DAX is limited to just two. Even where functions are identical, the ones in Excel will work with a range of cells, whereas the DAX equivalent will work with columns in a table:
Excel Function
DAX Function
Comments
SUM ( cell range )
SUM ( table[column] )
Excel works with a range of cells; DAX works with the column of a table.
MIN ( cell range )
MIN ( table[column] )
Excel works with a range of cells; DAX works with the column of a table.
MAX ( cell range )
MAX ( table[column] )
Excel works with a range of cells; DAX works with the column of a table.
MEDIAN ( number1, [number2], ... )
MEDIAN ( table[column] )
Excel works with a list of numbers of cells; DAX works with the column of a table.
AND ( logical1, [logical2], ...)
AND ( logical1, logical2 )
Excel supports up to 255 logical conditions; DAX only supports 2 logical conditions.
Table 1-1: Comparison of Excel and DAX functions
If you are already working with formulas in Excel, then you will be accustomed to working with cells and ranges of...

Table of contents

  1. Title Page
  2. Copyright and Credits
  3. Dedication
  4. About Packt
  5. Contributors
  6. Preface
  7. Section 1: Introduction to DAX for the BI Pro
  8. What is DAX?
  9. Using DAX Variables and Formatting
  10. Building Data Models
  11. Working with DAX in Power BI, Excel, and SSAS
  12. Getting It into Context
  13. Section 2: Understanding DAX Functions and Syntax
  14. Progressive DAX Syntax and Functions
  15. Table Functions
  16. Date, Time, and Time Intelligence Functions
  17. Filter Functions
  18. Statistical Functions
  19. Working with DAX Patterns
  20. Section 3: Taking DAX to the Next Level
  21. Optimizing Your Data Model
  22. Optimizing Your DAX Queries
  23. Other Books You May Enjoy