DAX is Not Just for Creating Measures: Using DAX to Create Measures, Columns, and Tables

When talking about DAX (Data Analysis Expressions), many people might think of creating Measures for various calculations in Power BI. However, in reality, DAX can be used to create Measures, Columns, and Tables, each with different purposes and uses. In this article, we will explore the differences between Measures, Columns, and Tables, along with some common DAX formulas.

Measures

Measures are calculations that occur when data is analyzed. They are used to calculate values that change based on the context of data filtering or when creating summary tables (Pivot Tables). Measures do not store the calculated values but are recalculated each time they are called.

Example DAX formula for Measures:

Total Sales = SUM(Sales[SalesAmount])

This formula calculates the total sales amount from the SalesAmount column in the Sales table.

Columns

Columns, or Calculated Columns, are new columns added to an existing table. These columns are calculated and stored in the table, making them usable like any other regular column.

Example DAX formula for Columns:

Sales Tax = Sales[SalesAmount] * 0.07

This formula creates a new column named Sales Tax and calculates the sales tax by multiplying the SalesAmount by a tax rate of 7%.

Tables

Tables, or Calculated Tables, are new tables created using DAX. They can combine data from multiple tables or create new tables based on specific conditions. These calculated tables can be used in the data model just like regular tables.

Example DAX formula for Tables:

Filtered Sales = FILTER(Sales, Sales[SalesAmount] > 1000)

This formula creates a new table named Filtered Sales that only includes sales records with a sales amount greater than 1000.

DAX is a highly flexible tool for data management. We can use DAX to create Measures, Columns, and Tables based on our data analysis needs. Understanding the differences between Measures, Columns, and Tables will help us use DAX more effectively.

For those who are looking to start having a team to help with data analysis or create a data storage system in your organization, Davoy is ready to provide comprehensive data services starting at 25,000 baht per month. If you are interested in learning more, you can add us on Line: @DAVOY

Chat Widget - Davoy.tech