Skip main navigation

Introduction to DAX

..

Introduction To DAX

Data Analysis Expressions (DAX) is a programming language that is used throughout Microsoft Power BI for creating calculated columns, measures, and custom tables. It is a collection of functions, operators, and constants that can be used in a formula, or expression, to calculate and return one or more values. In Power BI, you can use different calculation techniques and functions to create measures or calculated columns.

Use Calculated Columns
DAX allows you to augment the data that you bring in from different data sources. For example, assume that you are importing data from a database that contains sales transactions.

You can start using DAX by creating a calculated column that multiplies the unit price with the quantity. The calculated column will create a value for each row called Total Price.

The value on the left side of the equal sign is the column name. The text on the right side of the equal sign is the DAX expression. This simple DAX expression takes the quantity value and multiplies it with the unit price value for each individual row.


Total Price = 'Sales OrderDetails'[Quantity] * 'Sales
OrderDetails'[Unit Price]

Use Measures

Calculated columns are useful, but you are required to operate row by row.
For example, consider a situation where you want an aggregation that
operates over the entire dataset and you want the total sales of all rows.

In the Quick measures window, you can select the calculation that you want
and the fields to run the calculation against.

Similar to how you created a calculated column, you can go to the Fields
list and select New measure.


Total Sales = sum('Sales OrderDetails'[Total Price])
This article is from the free online

Microsoft Power BI: Advanced Data Analysis and Visualisation

Created by
FutureLearn - Learning For Life

Reach your personal and professional goals

Unlock access to hundreds of expert online courses and degrees from top universities and educators to gain accredited qualifications and professional CV-building certificates.

Join over 18 million learners to launch, switch or build upon your career, all at your own pace, across a wide range of topic areas.

Start Learning now