Clicky

10 Basic DAX Functions You Can Learn Right Now

how-to Sep 11, 2023
Learn DAX Right Now

In Power BI, once you import and relate your data, the analysis step begins.

You’re going to want to learn some DAX.

Let's walk through some common DAX (Data Analysis Expressions) functions and how they work.

SUM Function

Purpose: Calculates the sum of values in a specified column.

Syntax: ‘SUM(table[column])`

Example: ‘SUM(Sales[Revenue])` calculates the total revenue in the "Sales" table.

 

AVERAGE Function:

Purpose: Calculates the average of values in a specified column.

Syntax: ‘AVERAGE(table[column])`

Example: ‘AVERAGE(Sales[Quantity])` calculates the average quantity sold in the "Sales" table.

 

COUNT Function:

Purpose: Counts the number of rows in a specified column that contain numbers.

Syntax: ‘COUNT(table[column])`

Example: ‘COUNT(Orders[OrderID])` counts the number of orders in the "Orders" table.

 

FILTER Function:

Purpose: Applies a filter to a table or column based on a specified condition.

Syntax: ‘FILTER(table, condition)`

Example: ‘FILTER(Product, Product[Category] = "Electronics")` filters the "Product" table to include only electronics products.

 

ALL Function:

Purpose: Removes filters from a table or column, returning all the data.

Syntax: ‘ALL(table)`

Example: ‘ALL(Customer)` removes any filters applied to the "Customer" table.

 

RELATED Function:

Purpose: Returns a related value from a related table.

Syntax: ‘RELATED(related_table[column])`

Example: ‘RELATED(Customer[CustomerName])` retrieves the customer name related to a transaction in the "Sales" table.

 

MAX Function:

Purpose: Returns the maximum value from a column.

Syntax: ‘MAX(table[column])`

Example: ‘MAX(Sales[Revenue])` finds the highest revenue in the "Sales" table.

 

MIN Function:

Purpose: Returns the minimum value from a column.

Syntax: ‘MIN(table[column])`

Example: ‘MIN(Product[Price])` finds the lowest price in the "Product" table.

 

IF Function:

Purpose: Performs a conditional calculation based on a specified condition.

Syntax: ‘IF(condition, value_if_true, value_if_false)`

Example: ‘IF(Sales[Quantity] > 100, "High", "Low")` categorizes sales as "High" or "Low" based on quantity.

 

DATE Functions:

Purpose: Various functions for working with dates, such as calculating the difference between dates or extracting components (year, month, day) from dates.

Examples: ‘YEAR(Date)`, `MONTH(Date)`, `DATEDIFF(StartDate, EndDate, "day")`.

 

These are just a few common DAX functions, but there are many more available for more complex calculations and data manipulations.

Understanding how these functions work is fundamental to creating meaningful reports and insights from your data in Power BI, Excel Power Pivot, and other DAX-supported tools.

Download My Free Guidebook

The 3-Step Plan for Getting Started With PowerBI

Learn the best way I've helped large and small companies adopt the best analytics tool you've ever seen. In this FREE guide, I'll show you my complete startup strategy for Power BI.

We hate SPAM. We will never sell your information, for any reason.