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

Ian Horne

Share book
  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

Ian Horne

Book details
Book preview
Table of contents
Citations

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

How do I cancel my subscription?
Simply head over to the account section in settings and click on “Cancel Subscription” - it’s as simple as that. After you cancel, your membership will stay active for the remainder of the time you’ve paid for. Learn more here.
Can/how do I download books?
At the moment all of our mobile-responsive ePub books are available to download via the app. Most of our PDFs are also available to download and we're working on making the final remaining ones downloadable now. Learn more here.
What is the difference between the pricing plans?
Both plans give you full access to the library and all of Perlego’s features. The only differences are the price and subscription period: With the annual plan you’ll save around 30% compared to 12 months on the monthly plan.
What is Perlego?
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.
Do you support text-to-speech?
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.
Is Hands-On Business Intelligence with DAX an online PDF/ePUB?
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 & Microsoft Programming. We have over one million books available in our catalogue for you to explore.

Information

Year
2020
ISBN
9781838828639
Edition
1

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