Skip to Content
Learning Microsoft Power BI
book

Learning Microsoft Power BI

by Jeremey Arnold
September 2022
Beginner to intermediate
307 pages
8h
English
O'Reilly Media, Inc.
Content preview from Learning Microsoft Power BI

Appendix A. Commonly Used DAX Expressions

In this appendix, I will go over the syntax of some of the most commonly used DAX functions in Power BI. These are organized by section, then alphabetically within that section. For each function, there will be a brief description of the purpose of the function, the syntax of the function, and then an example using that syntax.

This is not an exhaustive list of all the functions in the DAX language. That can be reviewed at “DAX Function Reference”.

As with many things, DAX is a prime example of the Pareto principle: 80% of all the problems (outputs) can be solved with 20% mastery (inputs).

Aggregation Functions

AVERAGE

Definition

Returns the average (mean) of all the numerical values of a column.

Syntax

AVERAGE ( [ColumnName] )

Example

AverageScore = AVERAGE ( GradeScore[Score] )

AVERAGEX

Definition

Calculates the average (mean) of a set of expressions evaluated over each row of a table.

Syntax

AVERAGEX ( 'TableName' , <expression> )

Example

AverageScorePercentage = AVERAGEX ( 'GradeScores', 'GradeScores'[Score] + 
  'GradeScores'[MaximumPossibleScore] )

COUNT

Definition

Returns the number of records for a column that are not blank.

Syntax

COUNT ( [ColumnName] )

Example

CountOfStudents = COUNT ( 'UniversitySuppliedData'[StudentID] )

DISTINCTCOUNT

Definition

Returns the number of distinct values for a given column.

Syntax

DISTINCTCOUNT ( [ColumnName] )

Example

 CountOfStudents = DISTINCTCOUNT ( 'GradeScores'[StudentID] ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Learning Microsoft Power BI

Learning Microsoft Power BI

Reid Havens
Microsoft Power BI - A Complete Introduction [2023 EDITION]

Microsoft Power BI - A Complete Introduction [2023 EDITION]

Academind by Maximilian Schwarzmüller GmbH, Manuel Lorenz

Publisher Resources

ISBN: 9781098112837Errata Page